• Head First JavaScript 第七章:7 类型、相等、转换等系统地讨论类型


    2019-12-06

    09:27:16

          

     

     

     

    <!doctype html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
        <title>My Playlist</title>
      <script>
          /*function addSongs(){
              var song1 = document.getElementById("song1");
              var song2 = document.getElementById("song2");
              var song3 = document.getElementById("song3");
              song1.innerHTML = "Blue Suede Strings,by Elvis Pagely";
              song2.innerHTML = "Great Objects on Fire";
              song3.innerHTML = "儿子";
          }
          window.onload = addSongs;*/
    function lieDetectorTest(){
        var lies = 0;
        var stolenDiamond = { };
        if(stolenDiamond){
            console.log("You stole the diamond");
            lies++;
        }
        var car ={
            keysInPocket:null
        };
        if(car.keysInPocket){
            console.log("Un oh,guess you stole the car!");
            lies++;
        }
        if(car.emptyGasTank){
            console.log("You drove the car after you stole it");
            lies++;
        }
        var foundYouAtTheCrimeScene = [ ];
        if(foundYouAtTheCrimeScene){
            console.log("A sure sign of guilt");
            lies++;
        }
        if(foundYouAtTheCrimeScene[0]){
            console.log("Caught with a stolen item");
        }
        var yourName = " ";
        if(yourName){
            console.log("Guess you lied about your name");
            lies++;
        }
        return lies;
    }
    var numberOfLies = lieDetectorTest();
    console.log("You told" + numberOfLies + "lies");
    if(numberOfLies>=3){
        console.log("Guilty as charged");
    }
      </script>
      </head>
      <body>
          <h1>My awesome playlist</h1>
          <ul id = "playlist">
              <li id = "song1"></li>
              <li id="song2"></li>
              <li id = "song3"></li>
          </ul>
          
      </body>
    </html>

     

     

  • 相关阅读:
    关于路径的小知识点
    转发与重定向
    一种反复的读写文件的方法
    文字排版reportlab
    Qgis中插件的安装位置
    spyder打开文件假死解决
    地图跳跃-超级码力
    尾部的零
    一探torch.nn究竟“What is torch.nn really?”
    KAZE特征和各向异性扩散滤波
  • 原文地址:https://www.cnblogs.com/JasonPeng1/p/11994637.html
Copyright © 2020-2023  润新知