Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What does this return? [...'Lydia'];
Home
JavaScript
What does this return? [...'Lydia'];
0
votes
asked
Mar 7
in
JavaScript
by
DavidAnderson
What does this return?
[
...
'Lydia'
]
;
A:
["L", "y", "d", "i", "a"]
B:
["Lydia"]
C:
[[], "Lydia"]
D:
[["L", "y", "d", "i", "a"]]
javascript-interview-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Mar 7
by
DavidAnderson
Answer: A
A string is an iterable. The spread operator maps every character of an iterable to one element.
Related questions
0
votes
Q: What's the output? const person = { name: 'Lydia' }; function sayHi(age) { return `${this.name} is ${age}`; }
asked
Feb 27
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What's the output? String.prototype.giveLydiaPizza = () => { return 'Just give Lydia pizza already!'; };
asked
Feb 26
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What's the output? class Person { constructor() { this.name = 'Lydia'; } }
asked
Mar 13
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What does this return ? const firstPromise = new Promise((res, rej) =>
asked
Mar 7
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: Is this a pure function? function sum(a, b) { return a + b; } A: Yes B: No
asked
Mar 11
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What's the output? function Car() { this.make = 'Lamborghini'; return { make: 'Maserati' }; }
asked
Mar 9
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What's the output? const name = 'Lydia'; console.log(name()); A: SyntaxErr
asked
Mar 13
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What's the output? const person = { name: 'Lydia', age: 21, };
asked
Mar 13
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What is the output? const person = { name: 'Lydia', age: 21, };
asked
Mar 12
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
0
votes
Q: What's the output? const { firstName: myName } = { firstName: 'Lydia' }; console.log(firstName);
asked
Mar 11
in
JavaScript
by
DavidAnderson
javascript-interview-questions-answers
...