0
点赞
收藏
分享

微信扫一扫

js 字符串拼接

素锦时年_1b00 2022-02-14 阅读 202
<!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>
举报

相关推荐

0 条评论