iamali
V2EX  ›  问与答

Chrome 控制台输入 console.log("ewrwer");回车输出 undefined???

  •  1
     
  •   iamali · Jun 27, 2019 · 1945 views
    This topic created in 2540 days ago, the information mentioned may be changed or developed.

    chrome 控制台 输入 console.log("ewrwer"); 回车 undefined 按理来说应该是输出字符串"ewrwer", 有没有人知道这是为啥???

    5 replies    2019-06-28 09:23:35 +08:00
    MotherShip
        1
    MotherShip  
       Jun 27, 2019
    Mountain
        2
    Mountain  
       Jun 27, 2019

    第一个 ewrwer 是 console.log 执行的效果,在 console 里显示了 ewrwer
    第二个 undefined 是 console 的效果,是 console.log 这个方法没有返回值
    Mountain
        3
    Mountain  
       Jun 27, 2019
    luckyx
        4
    luckyx  
       Jun 27, 2019 via iPhone
    console.log 没有返回值
    lazyrm
        5
    lazyrm  
       Jun 28, 2019
    lz 好可爱呢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5405 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 08:14 · PVG 16:14 · LAX 01:14 · JFK 04:14
    ♥ Do have faith in what you're doing.