Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Chapter 1
- 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.
- ### Chapter 2
- 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.
- ### Chapter 3
- Functions can be written in 3 different ways
- ```
- // Define f to hold a function value
- const f = function(a) {
- console.log(a + 2);
- };
- // Declare g to be a function
- function g(a, b) {
- return a * b * 3.5;
- }
- // A less verbose function value
- let h = a => a % 3;
- ```
- ### Chapter 4
- Properties are similar to attributes/methods in ruby. Arrays use similar properties to the ones in ruby as well.
- ### Chapter 5
- !function == method
- Methods are functions for an object.
- Constructor == Initialize?
- 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