MCPcopy Create free account
hub / github.com/appacademy/Module-1-Resources / testingVar

Function testingVar

w2/d4/scope.js:154–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152// console.log(test1);//undefined
153
154function testingVar() {
155 // * hosting var
156 // ! no error
157 // console.log(test1);// undefined
158 var test = 1;
159
160 // * var can be reassigned
161 test = 2;
162 console.log(test); // 2
163
164 // * var can re declared
165 var test = 3;
166 console.log(test); // 3
167
168 // ! since var is function scope
169 // * we can access var declared variables from an outer scope
170 if (true) {
171 var access = true;
172 }
173
174 // * var is function scoped
175 console.log(access); // true
176}
177
178testingVar();
179

Callers 1

scope.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected