let num = 100 ; num = 20 ; num = 6.66 ; num = 100 ; num = 0b110 ; num = 0o555 ; num = 0xf23 ; let flag = true ; flag = false ; flag = 20 > 30 ; const age = 18 ; const height = 1.88 ; const info = `my name is ${ name }, age is ${ age }, height is ${ height }` ; console . log ( info ) ; const names1 = [ "why" , "abc" , "cba" ] ; const names2 = [ "why" , "abc" , "cba" ] ; const myinfo = { name : "why" , age : 20 , height : 1.88 , } ; console . log ( myinfo . name ) ; const s1 = Symbol ( "identity" ) ; const s2 = Symbol ( "identity" ) ; const person = { [ s1 ] : "程序员" , [ s2 ] : "老师" , } ; const n = null ; const u = undefined ; enum Direction { EAST = 10 , WEST = 20 , NORTH = 30 , SOUTH = 40 } const d1 = Direction . EAST ; const d2 = Direction . NORTH ; console . log ( d1 ) ; console . log ( d2 ) ; console . log ( Direction [ 10 ] ) ; console . log ( Direction [ 30 ] ) ; const tInfo = [ "why" , 18 , 1.88 ] ; const item1 = tInfo [ 0 ] ; const item2 = tInfo [ 1 ] ; const aInfo = [ "why" , 18 , 1.88 ] ; const itema = aInfo [ 0 ] ; let a = "why" ; a = 123 ; a = true ; const aArray = [ "why" , 18 , 1.88 ] ; const sum = ( num1 , num2 ) => { return num1 + num2 ; } ; const sayHello = ( name ) => { console . log ( "hello " + name ) ; } ; const loopFunc = ( ) => { while ( true ) { console . log ( 123 ) ; } } ; const errFunc = ( ) => { throw new Error ( "函数发生错误" ) ; } ; const info1 = { name : "why" , age : 18 , } ; const info2 = { name : "kobe" , height : 1.98 , } ; const newInfo = Object . assign ( info1 , info2 ) ; console . log ( newInfo . height ) ; interface IA { name : string ; age : number ; sayHello : ( name : string ) => void ; } interface IB { name : string ; height : number ; run : ( ) => void ; } const abc = { name : "why" , age : 18 , height : 1.88 , sayHello : ( name ) => { console . log ( "Hello " + name ) ; } , run : ( ) => { console . log ( "running" ) ; } , } ; const newArray = [ "why" , 18 , 1.88 ] ; const cba = { name : "why" , age : 18 , sayHello : ( name ) => { console . log ( "Hello " + name ) ; } , } ; export { } ;