1
有美一人,清扬婉兮。邂逅相遇,适我愿兮。 ——《诗经·国风·郑风·野有蔓草》

标签,样式

    <script>
        let jie ='杰';
        // let blog = 'nice to meet you' + jie + 'hello,world';
        let blog = `<h1 style="color:red;">nice to meet you</h1>${jie}<br/>hello,world`;
        document.write(blog)
    </script>

变量,三元表达式


    <script>
        let a = 1;
        let b = 2;
        // let result = `${a+b}`;
        let result = `${a>b ? a : b}`;
        document.write(result)
    </script>

查找,复制

    <script>
        let jie ='杰';
        let blog = 'nice to meet youhello,world杰';
        document.write(blog.indexOf(jie));
        document.write(blog.includes(jie));
        document.write(blog.startsWith(jie))
        document.write(blog.endsWith(jie))
        document.write('jie'.repeat(3))
    </script>

渣渣辉
1.3k 声望147 粉丝