English subtitles

← consolelog() - JavaScript Basics

Get Embed Code
6 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. Don't forget the semicolon.
  2. JavaScript uses semicolons to signal the end of statements.
  3. Try console.log without the semicolon at the end and
  4. you'll see, that it still works.
  5. Most JavaScript interpreters are smart enough to guess when you
  6. need a semicolon.
  7. But they aren't perfect, so you shouldn't leave things to chance.
  8. >> Yeah, that's good to know.
  9. You know, in Python you don't have to use semicolons at all.
  10. When I was learning JavaScript, I had to keep reminding myself to include one.
  11. >> Yeah, that's pretty common.
  12. What about this undefined line here?
  13. >> It simply means that the console.log command returns undefined.
  14. Telling us that console.log doesn't create any new data we could save.
  15. This makes sense,
  16. because we only want to use console.log to print debugging information.
  17. >> For example, if I had a property like document.URL, every turn to
  18. string as the page's URL.
  19. >> Yeah, we can see it in closed in quotes telling us that we've got a string.