Blog by Sumana Harihareswara, Changeset founder
console.captain'slog
Hi, reader. I wrote this in 2013 and it's now more than five years old. So it may be very out of date; the world, and I, have changed a lot since I wrote it! I'm keeping this up for historical archive purposes, but the me of today may 100% disagree with what I said then. I rarely edit posts after publishing them, but if I do, I usually leave a note in italics to mark the edit and the reason. If this post is particularly offensive or breaches someone's privacy, please contact me.
This week I started remembering JavaScript (two years ago I picked up a little bit). A few fun things:
Math.random, make and use arrays and Objects, display things in a webpage, write for loops, get input from the user using prompt(), and put semicolons everywhere.
for loop keeps happening until the step when the run condition is no longer satisfied, so it's sort of more like a while loop? Anyway this tripped me up and gave me an off-by-one error until I grokked it.
print() and show() that give me stark errors in Node.
> 40+["yay", 23]
'40yay,23'
> 23+Object()
'23[object Object]'