Skip to main content Accessibility Feedback
← Back to Courses & Workshops

Variables, Functions, and Scope

Learn how to write and document code like a JavaScript pro.

Learn the ins-and-outs of variables, functions, and JavaScript scope in about an hour.

What are arrow functions? What’s function hoisting? What’s the difference between var, let, and const, and when should you use each? What’s “scope” and how does it work?



What you’ll learn

  • How to set, use, and update variables.
  • The difference between var, let, and const, and when to choose one over the others.
  • Different ways to conditionally set variables.
  • The difference between function expressions and function declarations, and which one to use.
  • What function hoisting is, and whether or not it’s a good thing.
  • How to scope your code, and why you want to.
  • How to pass data into functions with parameters and arguments.
  • How to define default function parameters.
  • How to use ES6 arrow functions, and some “gotchas” to look out for.
  • How to document your functions with JSDoc.

🧠 Multiple formats for different learning styles. Lessons include both written text and streaming HD videos (with captions). Watch or read on any device.

Loved your book, it's become a daily reference for me. Fantastic stuff!- Chris Baughman

Learn by doing with a real JavaScript project

Reinforce your learning and build your portfolio by applying JavaScript best practices to a real project. Together, we’ll use everything you’ve learned about variables, functions, and scope to clean up a poorly written script.



Coaching

Learning web development is hard! Don't go it alone. With the Lean Web Club, you get the support you need to achieve long-term success.

Live Video Q&A

Join live video office hours every few weeks. Ask questions, share works in progress, and get help with any big roadblocks.

Private Discord Access

Get 24/7 access to a private a private Discord community where you can chat with other students, get feedback on code, and ask questions in between office hours.

Video Q&A Library

Get instant access a growing library of dozens of past Q&A sessions.

Office Hours include live automated audio transcription for people who are hearing impaired, don't speak English as their native language, or simply prefer to read.

The cheat sheet and the ability to ask questions on Slack were worth the price of the book alone.- David Buchholz

A Sample Lesson

What are fat arrow functions and how do they work?


If you’re a beginner, or just looking to fill in some knowledge gaps, the Vanilla JavaScript Pocket Guides from Chris Ferdinandi are clear, informative and to the point. Cannot recommend enough!- Dino Koutrouzas

I've been stuck on the same JavaScript project for AGES, but I'm so happy because I've finally managed to finish it all thanks to Chris Ferdinandi!

I found out about him, signed up for his daily newsletter and bought his Vanilla JS Guides. I'm so glad I did because I've only worked through two of the guides and yet he's COMPLETELY changed the way I think about JavaScript.

Putting everything he's taught me into practice, I managed to rewrite the project over a weekend! He was even kind enough to personally help me on Slack with an aspect I was particularly struggling with... I SERIOUSLY recommend checking him out! 😄

- Kieran Barker
Chris’s pocket guides are great. I definitely recommend picking them up if you’re learning or interested in learning Vanilla JavaScript.- Scott Tirrell
I thank you from the bottom of my heart. If it had not been for you, I would not be able to learn JavaScript.- Patricia Parker
Wanting to learn JavaScript from scratch, make the transition from jQuery or some other library? Already pretty competent and just want to get better?

Chris Ferdinandi has got your back and his learning platform is a *tremendously good value*.- Jonathan Schofield
God, you're amazing... I'm learning so much from you.- Mojtaba Seyedi, Front End Developer
Ever wanted to ditch jQuery but not sure how? This book by Chris Ferdinandi will set you on the right path.- Jeremy Green


Not ready yet? Get daily developer tips.

Hate the complexity of modern front‑end web development? I send out a short email each weekday on how to build a simpler, more resilient web. Join over 14k others.

If you have any questions about anything, feel free to send me an email at chris@gomakethings.com.