JS代码未在vscode中运行

时间:2018-06-28 07:39:09

标签: javascript visual-studio-code

我正在尝试在vscode中运行此代码,但显示错误

error

代码:

let age = 6

// If 7 or under print message about child pricing
if (age <= 7) {
    console.log('You will get a child discount!')
}

// If 65 or older print message about senior discount
if (age >= 65) {
    console.log('You will get a senior discount!')
}

1 个答案:

答案 0 :(得分:0)

您将必须这样做:

 cd basics
 node ifstatements.js

你很好。