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

Challenge: Define local variable - JavaScript Tutorial

From the course: JavaScript: Scope

Start my 1-month free trial

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.

Contents