Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Predict the output
/
JavaScript
/
String methods
What does this program print?
from String methods
Node 24
intermediate
2 min
What does this program print?
JavaScript
Copy
const
icon
=
"😀"
;
console
.log
(
icon
.
length
,
[
...
icon].
length
);
1 1
2 1
2 2
It throws because spread cannot iterate strings.
Check
Copy code
Open in playground
Ask AI about this kata
Report an error
previous kata
Which call replaces every {{amount}} marker with the literal external value, even when th…
Quiz
next kata
What does this program print?
Predict the output
A new version is available
Reload