Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

strings and objects in JavaScript

572 views

Published on

  • Be the first to comment

  • Be the first to like this

strings and objects in JavaScript

  1. 1. Strings and Objects
  2. 2. STRING
  3. 3. “...”
  4. 4. var str_var = “...”
  5. 5. str_var.length
  6. 6. startsWith(str) & endsWith (str) & indexOf (str, pos) & lastIndexOf (str, pos) split(separator) & contains(str) & substr(start, len) & substring(start, end)
  7. 7. OBJECT
  8. 8. {}
  9. 9. var obj_var = {}
  10. 10. var obj_var = { prop_name : “prop”, method_name : function () { // method name } }
  11. 11. obj_var. prop_name
  12. 12. obj_var[‘prop_name’]
  13. 13. obj_var. method_name()
  14. 14. obj_var[‘method_name’]()
  15. 15. this
  16. 16. var obj_var = { prop_name : “prop”, method_name : function () { console.log( this.prop_name ) } }
  17. 17. window
  18. 18. var prop_name = “data”; var obj_var = { prop_name : “prop”, method_name : function () { console.log(prop_name ); } }
  19. 19. Primitive vs Reference Type
  20. 20. Data Wraper Utility Object Array Function Boolean Number String Math Date RegExp

×