crop_rotate
Run
<!DOCTYPE html> <html> <body> <h2>JavaScript Object Constructors</h2> <p id="demo"></p> <script> const x1 = new String(); // A new String object const x2 = new Number(); // A new Number object const x3 = new Boolean(); // A new Boolean object const x4 = new Object(); // A new Object object const x5 = new Array(); // A new Array object const x6 = new RegExp(); // A new RegExp object const x7 = new Function(); // A new Function object const x8 = new Date(); // A new Date object // Display the type of all objects document.getElementById("demo").innerHTML = "x1: " + typeof x1 + "<br>" + "x2: " + typeof x2 + "<br>" + "x3: " + typeof x3 + "<br>" + "x4: " + typeof x4 + "<br>" + "x5: " + typeof x5 + "<br>" + "x6: " + typeof x6 + "<br>" + "x7: " + typeof x7 + "<br>" + "x8: " + typeof x8 + "<br>"; </script> <p>There is no need to use new String(), new Number(), new Boolean(), new Array(), and new RegExp()</p> <p>Use literals instead like: myArray = []</p> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxib2R5Pg0KDQo8aDI+SmF2YVNjcmlwdCBPYmplY3QgQ29uc3RydWN0b3JzPC9oMj4NCg0KPHAgaWQ9ImRlbW8iPjwvcD4NCg0KPHNjcmlwdD4NCmNvbnN0IHgxID0gbmV3IFN0cmluZygpOyAgIC8vIEEgbmV3IFN0cmluZyBvYmplY3QNCmNvbnN0IHgyID0gbmV3IE51bWJlcigpOyAgIC8vIEEgbmV3IE51bWJlciBvYmplY3QNCmNvbnN0IHgzID0gbmV3IEJvb2xlYW4oKTsgIC8vIEEgbmV3IEJvb2xlYW4gb2JqZWN0DQpjb25zdCB4NCA9IG5ldyBPYmplY3QoKTsgICAvLyBBIG5ldyBPYmplY3Qgb2JqZWN0DQpjb25zdCB4NSA9IG5ldyBBcnJheSgpOyAgICAvLyBBIG5ldyBBcnJheSBvYmplY3QNCmNvbnN0IHg2ID0gbmV3IFJlZ0V4cCgpOyAgIC8vIEEgbmV3IFJlZ0V4cCBvYmplY3QNCmNvbnN0IHg3ID0gbmV3IEZ1bmN0aW9uKCk7IC8vIEEgbmV3IEZ1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