This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Introduction to Objects I Forum

View Course » View Exercise

1210 points
5077da0ec0d82102000032c3_879356129
Submitted by
tagSurfer77072
almost 5 years ago

What's the point about the "Batman" joke?

I don't see the laughing point of it.
Could anyone show me a little hint?
Thx.


7 votes

permalink

In that exercise's hint, this code

 Array(16).join( 'hero'-1) + "Batman";

will produce this output:

NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNBatman

because NaN (not a number) is the "result" (actually more of a placeholder so you know that there has been an error) of trying to calculate 'hero'-1 (it's NaN because you can't meaningfully subtract 1 from a String). The NaN is converted to a string and concatenated 16 times, then "Batman" is appended at the end.

The resulting string reads like someone is trying to sing or hum the Batman movie theme. It's kind of childish actually ;)

3117 points
Picture
Submitted by
Alex J
almost 5 years ago

3 Comments

81d71b58bbfeb83e86e831ffede7269f?s=140&d=retro Hun over 4 years ago

LOL I only get this after reading your explanation. && I laugh.

82dc435082a72b4b3de2befbb3d5744a?s=140&d=retro danwaldis about 4 years ago

I only got it also after reading the explanation. It would have worked a lot better with a sound track.... :)

5077da0ec0d82102000032c3_879356129 tagSurfer77072 almost 4 years ago

sorry for replying so late. thx a lot.


0 votes

permalink

I got it & it made me laugh. thanks!

594 points
50639116ec4d32000201ccd0_661100796
Submitted by
tinlizzy
over 4 years ago


0 votes

permalink

I hated this. I spent all day going through these lessons because I need to learn Javascript quickly, then I came across this STUPID joke that has nothing to do with the instructions for the problem, and which just seems stupid. Please leave your nerd jokes for your personal life and don't put up barriers to people who have no idea what you are talking about and don't care.

0 points
Default_user
Submitted by
anonymous
about 4 years ago

1 Comment

82dc435082a72b4b3de2befbb3d5744a?s=140&d=retro danwaldis about 4 years ago

These kind folks are handing you the lessons free on a silver platter. I would think you could be a little more gracious.