Use ASTExplorer.net to deepen your understanding of JavaScript - a podcast by Kent C. Dodds

from 2021-01-19T21:14:05

:: ::

Hi there friends So today, I wanted to talk about understanding the syntax
of JavaScript. Now, I most of us when we're learning JavaScript, we are
introduced to each part of syntax and some of its capabilities and we justkind of learn about that syntax through experience of working with it and
there's nothing wrong with that approach that's pretty like the the best
way to learn anything is really just practical application.But there are often things that you skip over when you just focus on
practical application ofThe of knowledge And especially if JavaScript isthe first language that you learn maybe because it does borrow syntax from
other languages. Maybe there are things that you just don't know are
possible or don't really have a good good grasp on because you don't
understand the fundamentals of that syntax in particular.So what I'm going to suggest to you is that anytime you see some syntax
that you're not super familiar with or you think it's one way but things
aren't working the way that you expect or something like that. Anytime you
see something syntax? I want you to copy that code.Into a tool called AST Explorer dot net. It's AST is an acronym for
abstract syntax trees, which does sound pretty complicated but I promiseyou that it's nothing magic. It's something that you can learn but go to
AST explorer.net paste in the code on the editor on the left and on theright side, you're going to see a representation of that code in what's
called an abstract syntax tree.You can represent it as like an JSON object or something. And each element
of syntax.Has a particular node name and a type and as you click around youshould be able to see the name of the AST node for the part of the code
that you're looking at.
And so AST Explorer can be a really great way for you to get anunderstanding of what the different parts of the code represent for the
computer and it can also help you get an idea of like, oh this is called animport specifier, but then when I do this with an object that's called an
object pattern.So, maybe those two things like the structuring and imports are not the
same.Thing which they aren't So you can go ahead and try some of that. And
you'll get a little deeper understanding. The other nice thing about this
is that it makes those things Googleable. So instead of saying, hey what's
that thing at the import statement or whatever.You can say I want to learn about import specifiers and then you can Google
around about that. So, hopefully that's helpful to use kind of interesting
to play around with AST explorer.net. I wish you the best of luck and Ihope you have a stellar day and we'll see you in the future.

Further episodes of 3 Minutes with Kent

Further podcasts by Kent C. Dodds

Website of Kent C. Dodds