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

Function testingConst

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

Source from the content-addressed store, hash-verified

232*/
233
234function testingConst() {
235 // * hoisting const
236 // ! error
237 // console.log(test);// ReferenceError: test is not defined
238 const test = 1;
239
240 // * const cannot be reassigned
241 // test = 2;
242 // console.log(test);// Cannot reassign a variable declared with const
243
244 // * const cannot be re declared
245 // const test = 3; // Cannot re declare a variable declared with const
246
247 // ! const is block scope
248 // ! we cannot access inner block from outer
249 if (true) {
250 const access = false;
251 }
252
253 // * const is block scopes
254 // console.log(access);// ReferenceError: access is not defined
255}
256
257testingConst();
258

Callers 1

scope.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected