<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<script>
//1.检测获取字符串的长度 length
var str = 'my name is yangy';
console.log(str.length);
//2.字符串的拼接
console.log('羊羊' + '好傻');//羊羊好傻
console.log('羊羊' + 18);//羊羊18
console.log(12 + 12);//24
console.log('12' + '12');//1212
</script>
</head>
<body>
</body>
</html>
js 字符串拼接
最新推荐文章于 2024-03-17 09:15:00 发布