Skip to content

Instantly share code, notes, and snippets.

@sicongzhao
Last active July 24, 2016 16:51
Show Gist options
  • Save sicongzhao/fd564eb15845f637fc2c3ae84960eb2c to your computer and use it in GitHub Desktop.
Save sicongzhao/fd564eb15845f637fc2c3ae84960eb2c to your computer and use it in GitHub Desktop.
javascript-notes

eval()

The eval() function evaluates or executes an argument.

If the argument is an expression, eval() evaluates the expression. If the argument is one or more JavaScript statements, eval() executes the statements.

spread operator

...

The spread operator allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) or multiple variables (for destructuring assignment) are expected.

spread operator is to tear down [] of an array.

  function myFunction(x, y, z) { }
  var args = [0, 1, 2];
  myFunction(...args);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment