Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    function x() {/* ... */}
    const x = function() {/* ... */}
    const x = function foo() {/* ... */}
    const x = (function() {/* ... */}).bind(this)
    const x = (function foo() {/* ... */}).bind(this)
    const x = () => {/* ... */}
    const x = () => /* ... */


Apart from hoisting (which has little to do with functions directly) and `this` these are all equivalent




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: