> [1].includes(1)
TypeError: [1].includes is not a function
at repl:1:5
at REPLServer.defaultEval (repl.js:260:27)
at bound (domain.js:287:14)
at REPLServer.runBound [as eval] (domain.js:300:12)
at REPLServer.<anonymous> (repl.js:429:12)
at emitOne (events.js:95:20)
at REPLServer.emit (events.js:182:7)
at REPLServer.Interface._onLine (readline.js:211:10)
at REPLServer.Interface._line (readline.js:550:8)
at REPLServer.Interface._ttyWrite (readline.js:827:14)
This is currently hidden behind a harmony flag:
$ node --harmony_array_includes
> [1, 2, 3].includes(2);
true
Works without a flag in master with V8 4.9:
> [1].includes(1)
true
Like @jbergstroem says, in node.js v5, it's behind the --harmony_array_includes
flag. Closing, not a bug.
Thanks guys. I didn't know about Harmony flags. I reported this after I'd searched the docs for "includes" and couldn't find an answer.
Most helpful comment
This is currently hidden behind a harmony flag: