Blue number in Chrome Dev Console?

前端 未结 2 1054
说谎
说谎 2021-02-19 00:54

In javascript I have a variable that I push to console.log then increment it and push it to the log again, which shows the below in the Chrome Dev Tools.

2条回答
  •  旧时难觅i
    2021-02-19 01:44

    Note the difference between using commas and plus signs in console.log()

    console.log( 'console.log("(" + 1 + ")"); // string concat' );
    console.log("( " + 999 + " )"); 
    
    console.log( 'console.log("(", 1, ")"); // string, number (blue), string' );
    console.log("(", 999, ")");
    

提交回复
热议问题