1.变量的声明
var name='king';
console.log(name);
2.常亮的声明与赋值
const PI=3.55;
const PI=3.84;
console.log(PI);
3.js最基本的三种输出方式
console.log('hello king');
document.write('hello king')
alert('hello king');
4.变量的命名规范
var name='king';
var name1='king';
var name_1='king';
var $name='king';
5.变量的赋值
var name='king';
var name='queen';
console.log(name);
console.log(typeof name);
6.声明变量与未声明变量
//1.声明变量不赋值,返回undefined
var hename
console.log(hename);
//2.直接输出未声明的变量,会报错
console.log(ahflk);
网友评论