I wrote some code in the Node.js console, and noticed sometimes it return an undefined
.
See the following code.
Some lines return undefined
but some don't.
What does the undefined
mean?
PS D:\test\hello> node
> "two\nlines"
'two\nlines'
> var s = "hello, world"
undefined
> s.charAt(0)
'h'
> s.charAt(s.length -1)
'd'
> var anyString = 'Mozilla';
undefined
> console.log(anyString.substring(3, 0));
Moz
undefined