You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strings, Numbers (including int and uint), and Boolean objects are usually instantiated using literal notation (var str:String = “text”). Objects and Arrays are often instantiated using the “new” operator – this is seldom necessary (only in the case of a fixed-length Array), and is slower.
var o:Object = {}; is faster than var o:Object = new Object();
and
var a:Array = []; is faster than var a:Array = new Array();
The text was updated successfully, but these errors were encountered:
Object literals are faster than the new operator
Strings, Numbers (including int and uint), and Boolean objects are usually instantiated using literal notation (var str:String = “text”). Objects and Arrays are often instantiated using the “new” operator – this is seldom necessary (only in the case of a fixed-length Array), and is slower.
var o:Object = {}; is faster than var o:Object = new Object();
and
var a:Array = []; is faster than var a:Array = new Array();
The text was updated successfully, but these errors were encountered: