var duck = 'cute';
function bathroom() {
var rubberDuck = 'squeaky';
function bathtub() {
var sailorDuck = 'nautical';
}
}
function pond() {
var realDuck = 'fluffy';
}
// There are 4 variables above: duck, rubberDuck, sailorDuck and realDuck
// all within different scopes.
// Given the functions and variables above, edit the arrays
// below to contain only the appropriate variable names
// as strings.
// This array should contain the variable names (as strings) accessible in the global scope.
var globalScope = ['duck', 'sailorDuck', 'rubberDuck', 'realDuck'];
// This array should contain the variable names (as strings) accessible in the bathroom function.
var bathroomScope = ['duck', 'sailorDuck', 'rubberDuck', 'realDuck'];
// This array should contain the variable names (as strings) accessible in the bathtub function.
var bathtubScope = ['duck', 'sailorDuck', 'rubberDuck', 'realDuck'];
// This array should contain the variable names (as strings) accessible in the pond function.
var pondScope = ['duck', 'sailorDuck', 'rubberDuck', 'realDuck'];
javascript-1/practice.js
Lines 105 to 134 in 3d2c348
Should replace into: