Sort out the notes on basic Javascript syntax. A series of previous articles are about understanding Javascript. This article aims to further learn the basic javascript syntax. I hope you will continue to pay attention to it.
1. What is a variable?
The variable is a variable volume;
Programming: a variable is used to store certain values. We can think of variables as a box to store items, such as clothes, toys, and fruits.
2. express your thoughts (expressions)
Expressions are similar to definitions in mathematics. An expression is an algebraic expression that connects constants and variables with certain values. An expression can contain constants or variables.
String expression :"I "+" love "+" you "+ mychar // write a string expression with the value as a string.
Numeric expression:Num + 5*32 + 2.5 // write a numerical expression with a value.
Boolean expression:2> 3 num = 5 num <60 // write a Boolean expression of true or flase.
James had 10 yuan, bought a book, and spent 5 yuan. Xiao Hong said, "You can buy a pencil case with the remaining money plus 6 yuan.