C
C
Cat Scientist2016-03-06 12:26:25
JavaScript
Cat Scientist, 2016-03-06 12:26:25

How to enable destructuring support in function parameters in Node.js?

I used to run with flags --harmony --harmony_destructuring- everything was fine. Now swears at SyntaxError: Unexpected token {.

'use strict';

function myFunc({firstName, lastName}) {
  // ...
}

UPD: Problem solved . For those who step on my rake:
I launched:, but I
node index.js --harmony --harmony_destructuringhad
to:
node --harmony --harmony_destructuring index.js

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Deodatuss, 2016-03-06
@Deodatuss

maybe there is no "use strict" on top; ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question