前端基础
ES6
let,var,const
- let声明的变量有严格的局部作用域,var没有
<script>
{
var a = 1;
let b = 2;
}
console.log(a); //1
console.log(b); //报错
</script>
大约 4 分钟
<script>
{
var a = 1;
let b = 2;
}
console.log(a); //1
console.log(b); //报错
</script>
npx create-react-app react-learning --template typescript
npm install -g typescript