DEV Community

Discussion on: An Overview of JavaScript Functions

Collapse
 
rouzbeh84 profile image
rouzbeh

No offense at all. This is mostly correct but i think it should still be proof read. from the callback section to the iife code. for instance this block

greet: function(){
  let self = this;   
  return ()=>{
        return 'hello' + ' ' +  self.name;  
  }      
}

would no longer need the self hack as function like here:

let person = {

  name: "Mark",
  greet: function(){
    return () => `hello ${this.name}`;  
    }      
  }

Casually tossing in 'hoisting' when discussing function declaration/expression may not be great for beginners?

Collapse
 
howtocodejs profile image
HowToCodejs • Edited

Thanks. Forgot to fix that.

Well, hoisting is kind of overrated. It's not quantum physics. Though, I do get your point. In an overview of functions, I felt that it was necessary to touch on the nuances of some of these function types. It just so happens that hoisting is one of them.