Cannot read property 'substring' of undefined


#1

console.log("January").substring(0,2)
console.log("Melbourne is great").substring(0,13)
console.log("hamburgers").substring(2,9)

January
TypeError: Cannot read property 'substring' of undefined


23 More substring practice
#2

The same error exists in all three. Move the ) to the very end and add a semi-colon.

console.log("January".substring(0,2));

Explanation of the error message:

console.log() is a function with no return value. This is where the undefined comes from. Being a non-object, non-string, there is no property, substring().