iamali
V2EX  ›  问与答

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

  •  1
     
  •   iamali · Jun 27, 2019 · 2229 views
    This topic created in 2709 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
    MotherShip
    Jun 27, 2019
    1
    Mountain
    Mountain
    Jun 27, 2019
    2

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