# 王聃
**Repository Path**: never-bald-web-group/wang-zhen
## Basic Information
- **Project Name**: 王聃
- **Description**: 课堂练习
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 2
- **Created**: 2022-03-06
- **Last Updated**: 2022-04-18
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 王聃
document.write("----------------------------------
");
//赋值运算符
var a=1;
var b=2;
document.write(a + "
");
document.write(b + "
");
a+=b;
document.write(a + "
");
a-=b;
document.write(a + "
");
a+=b;
document.write(a + "
");
a/=b;
document.write(a + "
");
document.write("----------------------------------
");
//比较运算符
var larger = (1+2) > (2+3);
document.write("(1+2) > (2+3) :""+ larger +
");
var larger = (1+2) < (2+3);
document.write("(1+2) < (2+3) :""+ larger +
");
var larger = (1+2) >= (2+1);
document.write("(1+2) >= (2+1) :""+ larger +
");
var larger = (1+2) <= (2+3);
document.write("(1+2) <= (2+3) :""+ larger +
");
var larger = (1+2) == 4;
document.write("(1+2) == 4 :""+ larger +
");
var larger = (1+2) != 4;
document.write("(1+2) != 4 :""+ larger +
");
document.write("----------------------------------
");
//逻辑运算符
var intersection = true&&(1>2) ;
document.write("true && (1+2) "+ intersection +"
");
var intersection = true||(1>2) ;
document.write("true || (1+2) "+ union +"
");
var intersection = true=!(1>2) ;
document.write("true =! (1+2) "+ not +"
");
document.write("----------------------------------
");
//条件运算符
var condition = (3>5) ? "你" "我" ;
document.write("(3>5) ? "你" "我" "+ condition +"
");
document.write( "-------------------------------------
");
// 字符串转数字
var a = Number("2018") + 1000;
document.write(a + "
");
document.write("Number('123'):" + Number("123") + "
");
document.write("Number('3.1415'):" + Number("3.1415") + "
");
document.write("Number('hao123'):" + Number("hao123") + "
");
document.write("Number('100px'):" + Number("100px"));
document.write("parseInt('123'):" + parseInt("123") + "
");
document.write("parseInt('3.1415'):" + parseInt("3.1415") + "
");
document.write("parseInt('hao123'):" + parseInt("hao123") + "
");
document.write("parseInt('100px'):" + parseInt("100px")+ "
");
document.write("parseInt('+123'):" + parseInt("+123") + "
");
document.write("parseInt('-123'):" + parseInt("-123")+ "
");
document.write("parseFloat('123'):" + parseFloat("123") + "
");
document.write("parseFloat('3.1415'):" + parseFloat("3.1415") + "
");
document.write("parseFloat('hao123'):" + parseFloat("hao123") + "
");
document.write("parseFloat('100px'):" + parseFloat("100px") + "
");
document.write( "-------------------------------------
");
// 数字转字符串
var a = 2018 + "";
var b = a + 1000;
document.write(b + "
");
var a = 2018;
var b = a.toString() + 1000;
document.write(b + "
");
document.write( "-------------------------------------
");
/*转义字符*/
document.write("绿叶,给你\"初恋\"般的感觉~");