Seg*_*Pal 2 javascript adobe-brackets
我在方括号中遇到此错误。
我想强调的事实是,这实际上是我第二次打开JS文件。正如我强调的那样,我还想强调一个事实,就是我不知道Eslint和node.js是什么。
StackOverflow和其他站点上的所有修复程序都假定知道上述实体的工作方式。
请帮助完成一个新手,以解决问题并学习新知识。
先感谢您!
这是一段代码,但是我认为这不会有任何帮助。
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript</title>
</head>
<body>
<h1>Javascript starter</h1>
<script src=Script.js> </script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
Javascript:
var now = 2018;
var yearJohn = 1989;
var fullAge = 18;
//Multiple operators
var isFullAge = now - yearJohn >= fullAge; //true
?onsole.log(isFullAge);
//Grouping
var ageJohn = now - yearJohn;
var ageMark = 35;
var average = (ageJohn + ageMark)/2;
console.log(average);
// Multiple assigments
var x, y;
x = y = (3 + 5) * 4 - 6; // 8 * 4 - 6 // 32 - 6 // 26
console.log(x, y);
// More operators
x *= 2;
console.log(x);
x += 10;
// eslint-disable-next-line no-console
console.log(x);
Run Code Online (Sandbox Code Playgroud)
小智 8
只需添加"no-console": 0到 .eslintrc.js 文件的规则部分即可。
例如
"rules": {
"no-console": 0
},
Run Code Online (Sandbox Code Playgroud)
如果确实是ESLint导致此更改出错,则可以通过禁用该特定行的规则来解决此问题:
// eslint-disable-next-line no-console
console.log(isFullAge);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2638 次 |
| 最近记录: |