Guest User

Untitled

a guest
Apr 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. ### Operator: `in`
  2. `x in y` returns `true` if `x` is a valid property of `y` or its prototype chain.
  3. ```JavaScript
  4. > "foo" in {foo: 3}
  5. true
  6. > 2 in ["a", "b", "c"]
  7. true
  8. ```
  9.  
  10. ### Operator: `typeof`
  11. `typeof x` or `typeof(x)` returns the type as a string.
  12.  
  13. ### Operator: `instanceof`
  14. `x instanceof y` returns true if `x` is an object of type `y`.
  15. ```JavaScript
  16. > class A {}
  17. > (new A) instanceof A
  18. true
  19. ```
  20.  
  21. ### Operator: `void`
  22. `void x` or `void(x)` evaluates expression `x` and returns `undefined`.
  23.  
  24. ### Keyword: `this`
  25. Refers to the current object.
  26.  
  27. # Keyword: `super`
  28. Refers to the parent of the current object.
  29. Usually to call the parent constructor:
  30. ```JavaScript
  31. > super(props)
  32. ```
  33. but also can be used to call functions on the parent:
  34. ```JavaScript
  35. > super.foo()
  36. ```
Add Comment
Please, Sign In to add comment