DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>"+"运算符的使用title>
<script>
var str1 = "'+'运算符";
var str2 = "使用测试";
console.log(str1 + str2); //操作数为两个字符串,执行字符串连接操作
console.log("11 + 5 = ",11 + 5); //操作数全部为数字,执行加法运算
console.log("'11' + 5 = ",'11' + 5); //存在一个字符串操作数,执行字符串连接操作
script>
head>
<body>
body>
html>
| 留言与评论(共有 0 条评论) “” |