Created
March 24, 2011 07:41
-
-
Save ahmadajmi/884710 to your computer and use it in GitHub Desktop.
Strings in javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = new String("foo"); // String Object | |
typeof str; // return "Object" | |
typeof str.valueOf(); // return "String" | |
var str = String("foo"); // Primitive String | |
typeof str; // return "String" | |
var str = "foo"; // Primitive String (literal) | |
typeof str; // return "String" | |
var str = String(45); // Primitive String also called String Function | |
typeof str; // return "String" | |
str; // return "45" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment