0

Var array=[1,2,3,4]; console.log(typeof ...array);

Guys why I got error it's a spread operator and spread operator return an array element???

5th Aug 2021, 3:28 AM
Aniket Ganguly
5 Respuestas
0
It should be var array=[1,2,3,4]; console.log(typeof(array)); console: object
5th Aug 2021, 3:55 AM
Pariket Thakur
Pariket Thakur - avatar
0
What does spread operator return??
5th Aug 2021, 3:57 AM
Aniket Ganguly
0
Aniket Ganguly Yes it returns array element but you can't check typeof like that even cannot assign to another variable.
5th Aug 2021, 4:11 AM
A͢J
A͢J - avatar
0
But why it's return an element 🤔🤔
5th Aug 2021, 4:13 AM
Aniket Ganguly
0
It doesn't return an element it returns all elements to be used for functions
5th Aug 2021, 4:19 AM
Eashan Morajkar
Eashan Morajkar - avatar