Scope for Beginners

Tiffany White,

function myFunction() { var b = "bar"; console.log(a+b); }

myFunction();

function myFunction() { //local variable, or local scope var b = "bar"; console.log(a+b); }

function yourFunction() { var c = "JavaScript is fun!"; return c; console.log(c); }

myFunction(); yourFunction();

function myFunction() { var b = "bar"; console.log(a+b); }

myFunction();

function myFunction() { //local variable, or local scope var b = "bar"; console.log(a+b); }

function yourFunction() { var c = "JavaScript is fun!"; return c; console.log(c); }

myFunction(); yourFunction();

© tiff.RSS