0

all,

I am trying to use Chrome or IE browser consoles to return some simple output like below.

var date = new Date(2016, 1, 14, 0, 0, 0);
console.log(new Intl.DateTimeFormat('en-US').format(date));

The consoles return 2/14/2016 which is the expected output, but it also returns 'undefined' string after the output. I don't know what it means and is it recommended to remove or not use 'console.log' when using browser consoles?

1 Answers1

0

The return value of the function

Refer the following So Question:

Why does JavaScript variable declaration at console results in "undefined" being printed?

Community
  • 1
  • 1
Venkat
  • 2,549
  • 2
  • 28
  • 61