In PHP you can append an item to an array in two ways
$arr=[];// like thisarray_push($arr,1);// or this$arr[]=2;// PHP, why would you do that to yourself?
It certainly could help avoid meaningless discussions. Not so long ago the javascript twitterverse got mad because apparently reduce is like 500 times slower than a for loop, and of course the performance people was all over the place saying: stop using reduce, your killing your app. Think about the children!!
Might also lead to less bugs, because there are less "tricky parts." Consider this javascript object:
Is not a terrible idea.
In PHP you can append an item to an array in two ways
It certainly could help avoid meaningless discussions. Not so long ago the javascript twitterverse got mad because apparently
reduce
is like 500 times slower than afor
loop, and of course the performance people was all over the place saying: stop using reduce, your killing your app. Think about the children!!Might also lead to less bugs, because there are less "tricky parts." Consider this javascript object:
Even though
diameter
andperimeter
are "methods" one of them raises an error.Apparently, they like to do things in 2 ways, because they have 2 ways of adding a single-line comment.