JavaScript Date(), Date.UTC() strange behavior with scope operator

Is that me doing something wrong or some known bug of using scope operator ([...arr]) with Date()/Date.UTC() constructor?

What confuses me:

x = [2015,5,1]; //(3) [2015, 5, 1]
new Date(2015, 5, 1); //Just as expected, Mon Jun 01 2015 00:00:00 GMT+0300 (Eastern European Summer Time)
new Date([...x]); //Fri May 01 2015 00:00:00 GMT+0300 (Eastern European Summer Time)
new Date(Date.UTC([...x])) //Invalid Date

p.s. I know, the latter is ambiguous, since Date() with more than 1 argument already returns UTC date

Answer:1

Date.UTC parameter is not an array.

Remove the array like :

x = [2015, 5, 1];
var d = new Date(Date.UTC(...x))
console.log(d)
Answer:2

I can't seem to pass Vue data into Vue component from an inline template. I'm getting this error instead: vue.min.js: Uncaught TypeError: Cannot read property 'type' of undefined Below is my ...

I can't seem to pass Vue data into Vue component from an inline template. I'm getting this error instead: vue.min.js: Uncaught TypeError: Cannot read property 'type' of undefined Below is my ...

  1. canvas
  2. canada
  3. cancelled
  4. canceled vs cancelled
  5. cancun
  6. canada goose
  7. cane corso
  8. canes
  9. canadian prime minister
  10. cancun flights
  11. canker sore
  12. candy
  13. cancer
  14. canon
  15. canvas prints
  16. cancer sign
  17. candace owens
  18. canada news
  19. candytopia
  20. canlis

I have a list of objects with a property called created: let objs = [ { id: "1", created: "2019-02-12 00:00:00" }, { id: "2", created: "2018-02-12 00:00:00" }, { id: "3", created: "2017-02-...

I have a list of objects with a property called created: let objs = [ { id: "1", created: "2019-02-12 00:00:00" }, { id: "2", created: "2018-02-12 00:00:00" }, { id: "3", created: "2017-02-...

  1. records cannot be deleted with this form access

I'm trying to make a to do-list using Bootstrap and Javascript, and every item on the list consists of a text which is user-input and three clickable glyphicons (edit, finished, remove), on which i ...

I'm trying to make a to do-list using Bootstrap and Javascript, and every item on the list consists of a text which is user-input and three clickable glyphicons (edit, finished, remove), on which i ...

The express framework comes with the express functions express.json() and express.urlencoded(). We have the body-parser library, which appears to do the same functions. My question is, does body-...

The express framework comes with the express functions express.json() and express.urlencoded(). We have the body-parser library, which appears to do the same functions. My question is, does body-...

  1. body parser json limit
  2. body parser json express
  3. body parser json
  4. body-parser json example
  5. body parser json error
  6. body parser json nodejs
  7. body parser json node
  8. body parser json options
  9. body-parser json validation
  10. body parser json request
  11. body-parser json text
  12. body-parser json problem
  13. body-parser json custom
  14. body-parser-json npm
  15. body parse json
  16. body( parse_json ) d results
  17. body-parser package.json
  18. express body parser json not working
  19. express body parser json example
  20. koa body parser json