Answer of ES6 Quiz
- 2
"func"
see: 9.2.12 SetFunctionName, 12.14.4 Runtime Semantics of AssignmentExpression
- 2
3
DOLPHIN.length
is 2
, however SpreadElement (String iterator) takes care of surrogate pair
- 3
3
Object.assign
puts all own properties without non-enumerable.
And Object.getOwnPropertySymbols
gets all Symbol keys whether enumerable or not.
- 2
[true, false, false]
__proto__
magic property affects *non-*ComputedPropertyName.
See: B.3.1 __proto__ Property Names in Object Initializers
- 1
"A"
ArrowFunction resolves to arguments
binding in a lexically same as this
, super
and new.target
.
See: 14.2.15 Runtime Semantics: Evaluation of ArrowFunction
- 3
"undefined"
{ foo: "BAR" }
is not parsed as ObjectLiteral, but as Block and LabelledStatement.
And that doesn't contains ReturnStatement, so return value is undefined.
- 3
[true, true, false]
String.raw
escapes EscapeSequence
- 1
"outside"
MethodDefinition set the function name but not binds. See: 14.3.10 Runtime Sematics: ProeprtyDefinitionEvaluation
- 4 thrown
SyntaxError
foo: function(){ return "FOO" }
is parsed as LabelledStatement, but missing function name.
- 4 thrown
SyntaxError
See: B.3.2 Labelled Function Declarations
- 5 thrown
TypeError
function of MethodDefinition doesn't have [[Construct]]
internal method.
- 1
1
RestParameter is appeared (not-simpleParameterList), ArgumentsObject is created as UnmappedArgumentsObject.
See: 9.2.13 FunctionDeclarationInstantiation, 9.4.4.6 CreateUnmappedArgumentsObject
- 3
[false, false, true, true, true]
sparse array vs. dense array.
- 3
[1]
Array.prototype.some validates whether the key is present or not, but Array.prototype.find doesn't.
- 3
4
See: https://twitter.com/rauschma/status/568063153755594752
- 2
[1, 2]
See: isNaN, Number.isNaN
- 1
2
Array.from
likes iterator rather than length
property.
See: Array.from