Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- JavaScript String Methods
- String Methods and Properties
- Primitive values, like "John Doe", cannot have properties or methods (because they are not objects).
- But with JavaScript, methods and properties are also available to primitive values, because JavaScript treats primitive values as objects when executing methods and properties.
- String Length
- The length property returns the length of a string:
- Example
- var txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- var sln = txt.length;
- try it http://ow.ly/UmYP309c7NS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement