Advertisement
AHMED1970

JavaScript String Methods

Feb 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. JavaScript String Methods
  2. String Methods and Properties
  3. Primitive values, like "John Doe", cannot have properties or methods (because they are not objects).
  4.  
  5. But with JavaScript, methods and properties are also available to primitive values, because JavaScript treats primitive values as objects when executing methods and properties.
  6.  
  7. String Length
  8. The length property returns the length of a string:
  9.  
  10. Example
  11. var txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  12. var sln = txt.length;
  13. try it     http://ow.ly/UmYP309c7NS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement