Copy codeThe Code is as follows:
Console. log ('---- 1 ----')
Console. log ('12' + '34') // '123'
Console. log ('12' + 34) // '123'
Console. log (12 + '34') // '123'
Console. log (12 + 34) // 46
Console. log ('---- 2 ----')
Console. log (+ '12' + '34') // '123'
Console. log (+ '12' + 34) // 46
Console. log (+ 12 + '34') // '123'
Console. log (+ 12 + 34) // 46
Console. log ('---- 3 ----')
Console. log (-'12' + '34') // '-1234'
Console. log (-'12' + 34) // 22
Console. log (-12 + '34') // '-1234'
Console. log (-12 + 34) // 22
Console. log ('---- 4 ----')
Console. log ('12'-'34') //-22
Console. log ('12'-34) //-22
Console. log (12-'34') //-22
Console. log (12-34) //-22
Console. log ('---- 5 ----')
Console. log (+ '12'-'34') //-22
Console. log (+ '12'-34) //-22
Console. log (+ 12-'34') //-22
Console. log (+ 12-34) //-22
Console. log ('---- 6 ----')
Console. log (-'12'-'34') //-22
Console. log (-'12'-34) //-22
Console. log (-12-'34') //-22
Console. log (-12-34) //-22
Add the numbers at the same time of string connection in javascript
Document. write (" ")
If I = 1, the above Code is output as
If you want to output 2.jpg, you should write it like this.
Document. write (" ")