Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get an error that says: missing ; before statement?

Tags:

javascript

console.log "january".substring(0,3);
console.log "melbourne is great".substring(0,12);
console.log "hamburgers".substring(4,10);

i am trying to understand why this won't work?

like image 774
Nz1 Avatar asked Nov 22 '25 01:11

Nz1


1 Answers

console.log() is a function. JavaScript is not Ruby, parens are required :)

Example:

console.log("january".substring(0,3));
like image 91
Gavin Jones Avatar answered Nov 23 '25 14:11

Gavin Jones



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!