Skip to content

Instantly share code, notes, and snippets.

@cutecycle
Created June 6, 2017 19:54
Show Gist options
  • Save cutecycle/4895f4941f88390907c3ba6c58361eae to your computer and use it in GitHub Desktop.
Save cutecycle/4895f4941f88390907c3ba6c58361eae to your computer and use it in GitHub Desktop.
boop
> a = {b: [1,2,3], c:[4,5,6]}
{ b: [ 1, 2, 3 ], c: [ 4, 5, 6 ] }
> function log(...args) { console.log(args) }
undefined
> log(a)
[ { b: [ 1, 2, 3 ], c: [ 4, 5, 6 ] } ]
undefined
> log(...a)
TypeError: (var)[Symbol.iterator] is not a function
at repl:1:8
at sigintHandlersWrap (vm.js:22:35)
at sigintHandlersWrap (vm.js:73:12)
at ContextifyScript.Script.runInThisContext (vm.js:21:12)
at REPLServer.defaultEval (repl.js:346:29)
at bound (domain.js:280:14)
at REPLServer.runBound [as eval] (domain.js:293:12)
at REPLServer.<anonymous> (repl.js:545:10)
at emitOne (events.js:101:20)
at REPLServer.emit (events.js:188:7)
> log(a.b)
[ [ 1, 2, 3 ] ]
undefined
> console.log(...a.b)
1 2 3
undefined
> log(a.b)
[ [ 1, 2, 3 ] ]
undefined
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment