// It can be combined with non-spread items. var c = [5, 6, ...a, 7, 9]; // c = [5, 6, 1, 2, 3, 4, 7, 9]; // For comparison, doing this without the spread operator // creates a nested array. var d = [a, a]; // d = [[1, 2, 3, 4], [1, 2, 3, 4]] // It works the same with function calls function foo(arg1, arg2, arg3) { console.log(arg1 + ':' + arg2 + ':' + arg3); } // You can use it even if it passes more parameters than the function will use foo(...a); // "1:2:3" → foo(a[0], a[1], a[2], a[3]); // You can mix it with non-spread parameters foo(5, ...a, 6); // "5:1:2" → foo(5, a[0], a[1], a[2], a[3], 6); // For comparison, doing this without the spread operator // assigns the array to arg1, and nothing to the other parameters. foo(a); // "1,2,3,4:undefined:undefined" When ... is used in a function declaration, it indicates a rest parameter. The rest parameter must be the final named parameter in the function's parameter list. It will be assigned an Array containing any arguments passed to the function in excess of the other named parameters. In other words, it gets "the rest" of the arguments passed to the function (hence the name). function foo(a, b, ...c) { console.log(c.length); } foo(1, 2, 3, 4, 5); // "3" → c = [3, 4, 5] foo('a', 'b'); // "0" → c = [] Rest parameters are similar to Javascript's arguments object, which is an array-like object that contains all of the parameters (named and unnamed) in the current function call. Unlike arguments, however, rest parameters are true Array objects, so methods such as .slice() and .sort() can be used on them directly. The ... operator can only be used with Array objects. (However, there is a proposal to extend it to Objects in a future ECMAScript standard.) Comparison Variables referencing objects are equal or identical only if they reference the same object: var obj1 = {a: 1}; var obj2 = {a: 1}; var obj3 = obj1; console.log(obj1 == obj2); //false console.log(obj3 == obj1); //true console.log(obj3 === obj1); //true See also String. Logical JavaScript provides four logical operators: unary negation (NOT = !a) binary disjunction (OR = a || b) and conjunction (AND = a && b) ternary conditional (c ? t : f) In the context of a logical operation, any expression evaluates