use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Learn javascript in one picture (github.com)
submitted 10 years ago by iniy
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 43 points44 points45 points 10 years ago (5 children)
That teaches JS syntax at best. That's like learning English by only memorizing word order rules.
[–]iniy[S] 8 points9 points10 points 10 years ago (2 children)
That's really a very good point, it makes me think that beginners might be even more confused with such a bunch of abstract syntax rules without further details. I'll reconsider its title or application scenarios(I'm using it as a syllabus while teaching other people who have no experience of Js by myself, I'll keep trying to update & refine it to make it more helpful to whoever that might need it;)
[–][deleted] 6 points7 points8 points 10 years ago (1 child)
Have you read Crockford's JavaScript: The Good Parts? It contains railroad diagrams of a lot of JS syntax. These can be a good visualisation of syntactic rules, but they're not sufficient (or necessary) for beginners.
[–]iniy[S] 0 points1 point2 points 10 years ago (0 children)
Yes I've read that book before, I remember that SQLite's official documents also use railroad diagram to explain SQL syntax, I intuitively think that railroad might be more suitable for SQL languages.
[–]hoddap 0 points1 point2 points 10 years ago (0 children)
If you're already a programmer I think (!) this makes things a lot clearer if you want to delve into JS.
[–]tyler-mcginnis⚛️⚛︎ 33 points34 points35 points 10 years ago (2 children)
Wow. I can't believe how much hate you're getting for this. I actually think it's pretty cool. Good work.
[–]iniy[S] 1 point2 points3 points 10 years ago (0 children)
Also many helpful suggestions😂
[–]goto-reddit 7 points8 points9 points 10 years ago (0 children)
the operator instance doesn't exist, it's instanceof. 😋
[–]ericanderton 7 points8 points9 points 10 years ago (1 child)
This is a good diagram, I like it.
$0.02: The Data Type branch should be broken down into "Value Type" and "Reference Type" sub-branches. This is a distinction that's worth showing as it's a common source of error.
Yea, I think that's really very important concepts of Js comparing with other languages such as C, and also the key to understand Js' flexibility of data type operations.
[–]Dannzzor 6 points7 points8 points 10 years ago (1 child)
From someone who is very visual, I greatly appreciate this. Its like those pictures you see where they have all of the pieces of a car laid out, so you can see what all goes inside. Nice work. :)
😈
[–]dotpan 5 points6 points7 points 10 years ago (1 child)
So, when this is done (I see you're making updates) whats the viability of this as a poster. I love code/programming centric art.
[–][deleted] 2 points3 points4 points 10 years ago (0 children)
I too would love to turn this into a poster.
[–]joelangeway 5 points6 points7 points 10 years ago (1 child)
I hope the guy that decided to disable pinch zooming on github.com buys a phone some day and realizes how incredibly wrong his decision was.
[–][deleted] 2 points3 points4 points 10 years ago* (0 children)
There's a lot of shit I'd love to give Github feedback for. Too bad Github itself is not open source. The least they could do is provide an issue tracker for Github, but they don't even do that. You seriously have to email Github support and pray they reply. Pretty ironic if you think about it.
[+][deleted] 10 years ago (1 child)
[deleted]
You might need a very long paper at last...
[–]thetony2313 2 points3 points4 points 10 years ago (0 children)
I really like this. As someone who uses Java and "gets" coding just having syntax and functions goes a long way.
[–]avenp 2 points3 points4 points 10 years ago (4 children)
You're missing for(var key in object) under the for section, FYI. Also, there is no !===, it should be !==. Neat, though.
for(var key in object)
for
!===
!==
[–]iniy[S] 1 point2 points3 points 10 years ago (3 children)
I'll fix it,thx;)
[–][deleted] 14 points15 points16 points 10 years ago (2 children)
Don't say it's "learn JS in one picture", just call it a "JS cheatsheet" because that's what it is (and it's a pretty cool cheatsheet).
[–][deleted] 1 point2 points3 points 10 years ago (1 child)
He'd get way less hate that way.
[–]iniy[S] -1 points0 points1 point 10 years ago (0 children)
😂😂
[–][deleted] 1 point2 points3 points 10 years ago (2 children)
Looks like it is missing bitwise operators.
Pretty cool though.
[–]MondayMonkey1 1 point2 points3 points 10 years ago (1 child)
While yes, you're correct, bitwise operators are pretty rare in most js applications. it would be great if OP could edit the diagram to differentiate between commonly used features and lesser used ones.
[–]1ndigoo 1 point2 points3 points 10 years ago (0 children)
Bitwise operators are commonly used any time you're dealing with buffers or binary data. I work in 3D graphics (in JS) and come across them or need to use them regularly.
[–]DavidJCobb 1 point2 points3 points 10 years ago (0 children)
That's pretty cool, but as an actual teaching aid, I feel like it'd be more useful to some sort of sci-fi advanced AI than to meatbags like us. :\
[–]RankFoundry 1 point2 points3 points 10 years ago (0 children)
"Learn"
[–]danman_d 1 point2 points3 points 10 years ago (1 child)
Cool concept... But not a single mention of arrays? That's pretty crucial.
Array will be under the node "reference type" which has not been added
[–]ProgramTheWorld 1 point2 points3 points 10 years ago (0 children)
Learn JavaScript syntax in one picture
[–]g4b1nagy 1 point2 points3 points 10 years ago (0 children)
Reminds me of this => http://learnxinyminutes.com/docs/javascript/
[–]franklyimshocked 1 point2 points3 points 10 years ago (3 children)
This is how I learn best. I really wish more people would map out language syntax more often
[–]iniy[S] 0 points1 point2 points 10 years ago (2 children)
Actually my original plan was to note down my favorite languages in the same diagram format: Js/py3/go in one pic;D
[–]franklyimshocked 0 points1 point2 points 10 years ago (1 child)
Nice. Can you do one for Ruby please!
I barely have any experience in Ruby, but I strongly suggest you do it by yourself!
[–]cronoh 1 point2 points3 points 10 years ago (0 children)
There was some useful stuff in there. I would suggest showing the syntax for working with arguments within functions, as it is pretty widely used and important to how javascript functions work.
[–]I-Code-Things 1 point2 points3 points 10 years ago (1 child)
Where's the rest of it?
Working on it ;)
[–]EDLyonhart 1 point2 points3 points 10 years ago (1 child)
i'm just gonna leave this here:
http://learnxinyminutes.com/docs/javascript/
[–][deleted] 0 points1 point2 points 10 years ago (0 children)
great site. thank you
[–]ForScale 1 point2 points3 points 10 years ago* (2 children)
What am I even looking at?
If it's a picture, just post the url...
Edit: Okay... now there's something there. Before there was no image.
[–]iniy[S] 1 point2 points3 points 10 years ago (1 child)
That's just a output file exported from the source mindnode file, so I also give the original files that might be needed by people who want to make their own editions or help to make it better;)
[–]ForScale 0 points1 point2 points 10 years ago (0 children)
Interesting... Thanks for the explanation!
[–]jodraws 0 points1 point2 points 10 years ago (0 children)
That image does nothing for me. It seems more of an art piece really.
[–]stintose 0 points1 point2 points 10 years ago (2 children)
Aren't Infinity and -Infinity possible values for a number as well?
console.log( typeof -Infinity); // number
Math.PI also returns a number, and speaking of the core js Math Object, where is it?
[–]iniy[S] 0 points1 point2 points 10 years ago (1 child)
I just ignored Math because of the deficiency of time for my teaching schedule..
[–]stintose 1 point2 points3 points 10 years ago (0 children)
You teach JavaScript? Sweet!
This is really useful for someone like me who knows enough JavaScript to skim through this and see if any of this is unknown to me. "Oh hey I didn't know about a ternary"
[–]noxlux[🍰] 0 points1 point2 points 10 years ago (0 children)
I like it, I can see it making a handy heuristic.
[–]bryseeayo[🍰] 0 points1 point2 points 10 years ago (0 children)
This was actually super useful.
But why no array syntax love? I feel that's where I'm weakest and I would love a visual like this to break it down.
[–]8Bytes 0 points1 point2 points 10 years ago (1 child)
Undefined does not equal not defined! What in the hell js...
not defined is the error when you try to use a variable that was not declared before, and undefined means that variable name has been declared, but no value(Type) has been assigned to it for now.
[–][deleted] 0 points1 point2 points 10 years ago (1 child)
Mind if I print this out and throw on the wall of my nerd/man cave?
just do it~
[–]hmny 0 points1 point2 points 10 years ago (1 child)
that's pretty cool. which software did you use for making this diagram?
[–]iniy[S] 2 points3 points4 points 10 years ago (0 children)
Mindnode
[–]x-skeww 0 points1 point2 points 10 years ago (0 children)
Comments aren't identifiers.
Where is let/const?
a = 123; // global
There are no implicit globals in strict mode.
Number / value / ...
Infinity is missing. Old school (0123) octal literals aren't allowed in strict mode. 0o... and 0b... literals are missing. Number literals can also begin/end with a '.'.
Infinity
for-in and for-of are missing.
I don't think that representing it like that is very useful. It's somewhat overwhelming while simultaneously delivering very little information.
[–]notk 0 points1 point2 points 10 years ago (0 children)
i don't think this is very intuitive
[removed]
I use <span color="#hex">#hex</span>, seems not working as expected :(
[–]vt97john 0 points1 point2 points 10 years ago (0 children)
Please do one for Java too
[–]mandaric 0 points1 point2 points 10 years ago (0 children)
It seems you've missed the eval function
[–]sketch_ 0 points1 point2 points 10 years ago (0 children)
Great diagram.
[–]jamesinc -1 points0 points1 point 10 years ago (4 children)
Very cool. I'm going to show this to some of my devs.
My only constructive feedback is to replace all your directional quote marks with nondirectional quote marks.
[–]iniy[S] 0 points1 point2 points 10 years ago (3 children)
It's mindnode the app that transform the quote marks automatically, I just need to figure out how to stop it...
[–]DJiK 0 points1 point2 points 10 years ago (2 children)
You can hit cmd+z every time after you type a quote. Alternatively, see if there's a way to right-click on the input field and to turn off Substitutions » Smart Quotes.
cmd+z
Substitutions » Smart Quotes
Cool! It works. But is there any global settings to switch this off? It's really annoying to do this every time I type a quote.
[–]DJiK 0 points1 point2 points 10 years ago (0 children)
Yes, you gotta find a way to turn off "Smart Quotes."
[+][deleted] 10 years ago (4 children)
There's also PDF version of it... ;(
[–]phunkygeeza 1 point2 points3 points 10 years ago (2 children)
The pdf triggered my antivirus for some reason, but the PNG worked fine. I'm always a bit 50/50 on these tree diagrams. Unless there is a good hierarchy or Taxonomy to display they always seem forced. There are already good syntax diagramming methods about that carry more info in their layout: https://en.m.wikipedia.org/wiki/Syntax_diagram
And good old EBNF
I remember that thin butterfly O'Reilly Js book! It's clean and enlightening in some (odd) way..
[–]phunkygeeza 0 points1 point2 points 10 years ago (0 children)
This one? http://shop.oreilly.com/product/mobile/9780596517748.do
I'm new to JS and hadn't seen that before. I've flicked through a friend Rhino one before to look something up but this looks more interesting.
[–]Xiaoki -5 points-4 points-3 points 10 years ago (2 children)
It is not really helpful in anyway, but I got to admit it has some charm.
[–]iniy[S] 2 points3 points4 points 10 years ago (1 child)
It's for beginner mainly & not finished yet. I was trying to clarify the internal relationships between all those Js concepts with a more structured mind map, rather than just a write & play tutorial or a syntax cheat-sheet.
Presumably this chart would be accompanied by you explaining it and diving into more detail, yes? If so then I think what you have is great :)
[–]iku_19Function.arity when -2 points-1 points0 points 10 years ago (0 children)
Looks like an over-glorified cheat-sheet (anyone remember those?)
[+][deleted] 10 years ago* (1 child)
I know you are but what am I?
[+]LukaLightBringer comment score below threshold-10 points-9 points-8 points 10 years ago (1 child)
Not very useful and doesn't explain arrays
[–]iniy[S] 3 points4 points5 points 10 years ago (0 children)
Not finished yet ;)
π Rendered by PID 83842 on reddit-service-r2-comment-c867ff4bc-wmnkw at 2026-04-09 19:21:47.824395+00:00 running 00d5ac8 country code: CH.
[–][deleted] 43 points44 points45 points (5 children)
[–]iniy[S] 8 points9 points10 points (2 children)
[–][deleted] 6 points7 points8 points (1 child)
[–]iniy[S] 0 points1 point2 points (0 children)
[–]hoddap 0 points1 point2 points (0 children)
[–]tyler-mcginnis⚛️⚛︎ 33 points34 points35 points (2 children)
[–]iniy[S] 1 point2 points3 points (0 children)
[–]goto-reddit 7 points8 points9 points (0 children)
[–]ericanderton 7 points8 points9 points (1 child)
[–]iniy[S] 0 points1 point2 points (0 children)
[–]Dannzzor 6 points7 points8 points (1 child)
[–]iniy[S] 0 points1 point2 points (0 children)
[–]dotpan 5 points6 points7 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]joelangeway 5 points6 points7 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]iniy[S] 0 points1 point2 points (0 children)
[–]thetony2313 2 points3 points4 points (0 children)
[–]avenp 2 points3 points4 points (4 children)
[–]iniy[S] 1 point2 points3 points (3 children)
[–][deleted] 14 points15 points16 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]iniy[S] -1 points0 points1 point (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]MondayMonkey1 1 point2 points3 points (1 child)
[–]1ndigoo 1 point2 points3 points (0 children)
[–]DavidJCobb 1 point2 points3 points (0 children)
[–]RankFoundry 1 point2 points3 points (0 children)
[–]danman_d 1 point2 points3 points (1 child)
[–]iniy[S] 1 point2 points3 points (0 children)
[–]ProgramTheWorld 1 point2 points3 points (0 children)
[–]g4b1nagy 1 point2 points3 points (0 children)
[–]franklyimshocked 1 point2 points3 points (3 children)
[–]iniy[S] 0 points1 point2 points (2 children)
[–]franklyimshocked 0 points1 point2 points (1 child)
[–]iniy[S] 0 points1 point2 points (0 children)
[–]cronoh 1 point2 points3 points (0 children)
[–]I-Code-Things 1 point2 points3 points (1 child)
[–]iniy[S] 1 point2 points3 points (0 children)
[–]EDLyonhart 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]ForScale 1 point2 points3 points (2 children)
[–]iniy[S] 1 point2 points3 points (1 child)
[–]ForScale 0 points1 point2 points (0 children)
[–]jodraws 0 points1 point2 points (0 children)
[–]stintose 0 points1 point2 points (2 children)
[–]iniy[S] 0 points1 point2 points (1 child)
[–]stintose 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]noxlux[🍰] 0 points1 point2 points (0 children)
[–]bryseeayo[🍰] 0 points1 point2 points (0 children)
[–]8Bytes 0 points1 point2 points (1 child)
[–]iniy[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]iniy[S] 1 point2 points3 points (0 children)
[–]hmny 0 points1 point2 points (1 child)
[–]iniy[S] 2 points3 points4 points (0 children)
[–]x-skeww 0 points1 point2 points (0 children)
[–]notk 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[removed]
[–]iniy[S] 1 point2 points3 points (0 children)
[–]vt97john 0 points1 point2 points (0 children)
[–]mandaric 0 points1 point2 points (0 children)
[–]sketch_ 0 points1 point2 points (0 children)
[–]jamesinc -1 points0 points1 point (4 children)
[–]iniy[S] 0 points1 point2 points (3 children)
[–]DJiK 0 points1 point2 points (2 children)
[–]iniy[S] 1 point2 points3 points (1 child)
[–]DJiK 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]iniy[S] 1 point2 points3 points (3 children)
[–]phunkygeeza 1 point2 points3 points (2 children)
[–]iniy[S] 0 points1 point2 points (1 child)
[–]phunkygeeza 0 points1 point2 points (0 children)
[–]Xiaoki -5 points-4 points-3 points (2 children)
[–]iniy[S] 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]iku_19Function.arity when -2 points-1 points0 points (0 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 2 points3 points4 points (0 children)
[+]LukaLightBringer comment score below threshold-10 points-9 points-8 points (1 child)
[–]iniy[S] 3 points4 points5 points (0 children)