Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. ### Chapter 1
  2.  
  3. Javascript data type values are almost identical to the ones in ruby. These include numbers(integers, fractionals), strings to represent text, booleans, and empty values(null, undefined). Operators are also very simliar expect the use of `typeof` instead of `.class` to define the type of value.
  4.  
  5. ### Chapter 2
  6.  
  7. Javascript programs are built out of statements which sometimes contain more statements. Statements tend to be built out of expressions which return a value. Programs are usually executed from top to bottom but you can disrupt this flow with conditionals and loops. Bindings are values of data that are defined under a name. Functions == methods.
  8.  
  9. ### Chapter 3
  10.  
  11. Functions can be written in 3 different ways
  12.  
  13. ```
  14. // Define f to hold a function value
  15. const f = function(a) {
  16. console.log(a + 2);
  17. };
  18.  
  19. // Declare g to be a function
  20. function g(a, b) {
  21. return a * b * 3.5;
  22. }
  23.  
  24. // A less verbose function value
  25. let h = a => a % 3;
  26. ```
  27.  
  28. ### Chapter 4
  29.  
  30. Properties are similar to attributes/methods in ruby. Arrays use similar properties to the ones in ruby as well.
  31.  
  32. ### Chapter 5
  33.  
  34. !function == method
  35. Methods are functions for an object.
  36.  
  37. Constructor == Initialize?
  38.  
  39. When creating objects and its properties and methods, you have to be much more explicit than ruby.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement