From the course: JavaScript: Scope
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Define local variable - JavaScript Tutorial
From the course: JavaScript: Scope
Challenge: Define local variable
- [Instructor] So like we've done in the previous chapter, let's challenge you to code an example of a local variable. So here's the challenge. Define a function that console logs both a local and a global variable. But instead of working with strings, this time multiply two numbers which a number of warriors in an army. And in your code, test that the local variables are indeed not available globally. So good luck and I'll see you next.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.