简体   繁体   English

为什么我会收到错误消息:在声明之前?

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

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? 我想知道为什么这不起作用?

console.log() is a function. console.log()是一个函数。 JavaScript is not Ruby, parens are required :) JavaScript不是Ruby,需要parens :)

Example: 例:

console.log("january".substring(0,3));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM