Skip to main content
added 4 characters in body
Source Link
Jonas Wilms
  • 139.3k
  • 20
  • 164
  • 164

Cause this has nothing todo with the variables passed. Dont use it here. Simply do:

     function bar({a = 0} = {}){
       console.log(a)
     }

     bar({});//0
     bar();//0
     bar({a:10});//10

Cause this has nothing todo with the variables passed. Dont use it here. Simply do:

     function bar({a = 0}){
       console.log(a)
     }

     bar({});//0
     bar({a:10});//10

Cause this has nothing todo with the variables passed. Dont use it here. Simply do:

     function bar({a = 0} = {}){
       console.log(a)
     }

     bar({});//0
     bar();//0
     bar({a:10});//10

deleted 1 character in body
Source Link
Jonas Wilms
  • 139.3k
  • 20
  • 164
  • 164

Cause this has nothing todo with the variables passed. Dont use it here. Simply do:

     function bar({a = 0} = {}){
       console.log(a)
     }

     bar({});//0
     bar({a:10});//10

Cause this has nothing todo with the variables passed. Dont use it here. Simply do:

     function bar({a = 0} = {}){
       console.log(a)
     }

     bar();//0
     bar({a:10});//10

Cause this has nothing todo with the variables passed. Dont use it here. Simply do:

     function bar({a = 0}){
       console.log(a)
     }

     bar({});//0
     bar({a:10});//10

added 5 characters in body
Source Link
Jonas Wilms
  • 139.3k
  • 20
  • 164
  • 164

Cause this has nothing todo with the variables passed. Dont use it here. Simply do:

     function bar({a = 0} = {}){
       console.log(a)
     }

     bar();//0
     bar({a:10});//10

Cause this has nothing todo with the variables passed. Dont use it here. Simply do:

     function bar({a = 0}){
       console.log(a)
     }

     bar();//0
     bar({a:10});//10

Cause this has nothing todo with the variables passed. Dont use it here. Simply do:

     function bar({a = 0} = {}){
       console.log(a)
     }

     bar();//0
     bar({a:10});//10

added 147 characters in body
Source Link
Scott Marcus
  • 66k
  • 6
  • 54
  • 81
Loading
Source Link
Jonas Wilms
  • 139.3k
  • 20
  • 164
  • 164
Loading