Chrome doesn't support some JavaScript features? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Chrome doesn't support some JavaScript features?

I'm using Visual Studio Code and Chrome to compile codes. console.log doesn't work when I use it to output a value. It shows a blank screen. It's the same when I use the developer tool. Also escaping characters like \n (new line) and \t (tab) doesn't work either. When I use it in between a string it still outputs the default string without any changes. What could be wrong? I am a beginner in Javascript programming.

30th Oct 2020, 1:11 PM
Logos
Logos - avatar
7 Answers
+ 2
Ore It's working in the JS console. Thank you.
30th Oct 2020, 2:01 PM
Logos
Logos - avatar
+ 1
console.log should work. I think there is an error in your code. Did it give any error? Browser's ignore all whitespace e.g \n, \t. It will be converted to a single space character. For an HTML line break, use the <br> tag. For tabs, use the Unicode form, &emsp;
30th Oct 2020, 1:16 PM
Ore
Ore - avatar
+ 1
Most of differences has ms internet explorer. For production‘s code will be needed to know the compatibilities for web browsers.
30th Oct 2020, 1:20 PM
JaScript
JaScript - avatar
+ 1
Eddy Ricchy console.log does not print anything to the web page. It logs it's arguments to the JS console. The JS console is provided by most browsers for debugging purposes. In Chrome you can access the console with Ctrl+Shift+J command. Or simply switch to the console tab in devtools
30th Oct 2020, 1:39 PM
Ore
Ore - avatar
0
Ore It doesn't give any error. The output of the console.log just doesn't appear on the chrome browser.
30th Oct 2020, 1:26 PM
Logos
Logos - avatar
0
Eddy Ricchy You are welcome. Mark my answer as best?
30th Oct 2020, 2:07 PM
Ore
Ore - avatar
0
Ore How do I do that?
30th Oct 2020, 2:20 PM
Logos
Logos - avatar