stevenhu — 2013-12-27T18:11:01-05:00 — #1
ralphm — 2013-12-27T18:30:48-05:00 — #2
felgall — 2013-12-27T18:44:27-05:00 — #3
stevenhu — 2013-12-27T19:00:56-05:00 — #4
pullo — 2013-12-28T01:50:48-05:00 — #5
You are on the right track with the MDN site.
This is where I go if I want to look stuff up.
To answer your question, if you type "String" into the search box in the top right hand corner, the first two entries will be for
string - the function which converts the given argument to a string and
String - the global object.
If you click on the second two of these results, you can see all of String's properties and methods.
system — 2013-12-28T01:51:56-05:00 — #6
Open up the Console in Developer Tools in any browser. For strings native methods, type
You'll get a comprehensive hierarchical listing of every kind of property.
If you want a more in-depth look at the global object, type
What this means is that when you create a string variable
var s = "string";
inferred s type is String
var s = String("string");
var s = new String("string");
String.constructor method is called to create the value "string". s prototype's is now String.prototype, and s inherits those methods, including length.
system — 2014-10-08T01:22:33-04:00 — #7
This topic is now closed. New replies are no longer allowed.