为什么在ES6的箭头函数中没有定义参数?

时间:2015-10-23 08:49:26

标签: javascript ecmascript-6

对于此代码

FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc] init];

loginButton.center = self.view.center;


loginButton.readPermissions= @[@"public_profile", @"email", @"user_friends"];
loginButton.delegate=self;

if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone )
{
    if ((int)[[UIScreen mainScreen] bounds].size.height == 568 || (int)[[UIScreen mainScreen] bounds].size.height == 480)
    {
        loginButton.frame=CGRectMake(26, 450, 270, 50);
    }
    else if((int)[[UIScreen mainScreen] bounds].size.height == 667)
    {
        loginButton.frame=CGRectMake(26, 450, 270, 50);
    }
    else
    {
        loginButton.frame=CGRectMake(26, 450, 270, 50);
    }
}


[loginButton setBackgroundImage:[UIImage imageNamed:@"fb.png"] forState:UIControlStateNormal];
[loginButton setBackgroundImage:[UIImage imageNamed:@"fb.png"] forState:UIControlStateSelected];
[loginButton setBackgroundImage:[UIImage imageNamed:@"fb.png"] forState:UIControlStateHighlighted];

[loginButton setTitle:@"Register to Facebook" forState:UIControlStateNormal];

[self.view addSubview:loginButton];

获取错误var sum = () => {console.log(arguments); ... } sum(2, 3)

为什么在箭头功能中没有定义Uncaught ReferenceError: arguments is not defined

0 个答案:

没有答案