const { log } = console;// ⭐️ var hoisting// ----------------// • identifier: IS hoisted❗// • value : initialized to `undefined`❗// <-------- greeting === undefined// <-------- greeting2 === undefined// ⭐️ identifiers `greeting`, `greeting2`:// • can be referenced now❗ (no ReferenceError)log(greeting,typeof greeting ); // undefined, 'undefined'log(greeting2,typeof greeting2); // undefined, 'undefined'// ⭐️ reassign before declaration is OK greeting2 ="Hello!"; log(greeting2); // Hello!// ⭐️ identifier `greeting`:// • can't be called (not a "function") yet❗(⛔ TypeError)greeting(); // ⛔ TypeError: 'greeting' is not a function// ⭐️ the following are "var declarations"// ⭐️ "var declaration" is related to "var hoisting"// ------------------------------------------------------// • identifier: hoisted to top of scope❗// • value : initialized to `undefined`❗// ------------------------------------------------------// ⭐️ var declarations// ╭─ id ─╮ ╭── value ──╮ (value: function expression)vargreeting=function() {console.log("Hello!");};// ╭─ id ──╮ ╭─value─╮ (value: string)var greeting2 ="Howdy!" ;