0
> const a= 1
< undefined

When you define a value in the browsers console, you got a message 'undefined'. What does this 'undefined' mean in the browser's console? ​

  • 3
    Does this answer your question? [Why does JavaScript variable declaration at console results in "undefined" being printed?](https://stackoverflow.com/questions/22844840/why-does-javascript-variable-declaration-at-console-results-in-undefined-being) – Henry Ecker Apr 18 '21 at 18:35
  • That's the return value of using the assignment operator. You always get a response by the Javascript Engine when you write an expression of any type. Try to write a function declaration on the console and press enter to see what the Engine returns after declaring that function. The same happens when you write a primitive: If you write the primitive 5 you get back 5 as a response. – Lucas David Ferrero Apr 18 '21 at 18:41

1 Answers1

0

That the expression does not produce a value

function doIt(){
    return 1
}

undefined

doIt()

1

ManuelMB
  • 1,254
  • 2
  • 8
  • 16