3 ms·
Have you learned about the browser developer tools? If you're using Chrome, you can press ctrl+shift+j to open them. On Firefox, it's ctrl+shift+k. Then you ca
by xiaoma 10y ago
Have you learned about the browser developer tools? If you're using Chrome, you can press ctrl+shift+j to open them. On Firefox, it's ctrl+shift+k.
Then you can type in JavaScript expressions and see what they evaluate to. Even better than that, it has auto-complete functionality. I noticed you asked a question on SO about checking the length of a string (you named it str). If you type
var str = "asdf";
and then
str.
into the command line of the developer tools you can actually see all the properties of your string and tab to auto-complete to .length or whatever else you'd like to see. It's a really quick way of poking around and experimenting with things to see how they work. There are a lot of other features like debugging break points that you'll discover over time, too. Good luck!