Thursday, April 4, 2024

Abdulkareemjavascript

  1.Using arrow function:const first = ()=>{const greet='Hi';const second = ()=>{const name='john';console.error(greet);}return second;}const newFunc =first();Notes:here do call the function of first have to assign const variable and call that as variable name (Example:newFunc();)2.ClosuresExample:function createGreeter(greeting) {  return function(name) {    alert(greeting...