Catrobat / deprecated_Jira_6.4.12_Timesheet

1 stars 2 forks source link

Don't use new Array() #5

Closed robertpainsi closed 7 years ago

robertpainsi commented 8 years ago
let a = new Array() // don't
let a = [] // do

You never need to use new Object() in JavaScript. Use the object literal {} instead. Similarly, don’t use new Array(), use the array literal [] instead. Arrays in JavaScript work nothing like the arrays in Java, and use of the Java-like syntax will confuse you.
Do not use new Number, new String, or new Boolean. These forms produce unnecessary object wrappers. Just use simple literals instead.

MarkusHobisch commented 8 years ago

ok, thx you a lot for your recommendations.