📜  如何声明一个变量 js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:51.888000             🧑  作者: Mango

代码示例2
// 3 ways to create

var mrVariable = 'x'; // You can set it to to a string ( '' ) or no. ( 0 ). It 
// is globally defined

let myVariaible2 = 'y'; // You can set it to string or no. let is block scoped

const myVariable = 'z'; // It is block scoped, can be a string or no. and can't 
//be reassigned