5. Pair programming
Design quality Learning
Two programmers work together at
one workstation.
One, the driver, writes code
while the other, the navigator,
reviews each line of code as it is
typed in.
https://en.wikipedia.org/wiki/Pair_programming
6. Better code (in my opinion)
Readability
Maintainability
var i = 5
What does “i” variable means?
function calMaxAndExcludeOddNumbersInArr(arr)
Too many roles!
7. Modern Javascript (ES2015)
Better code part2
https://github.com/metagrover/ES6-for-humans
https://babeljs.io/docs/learn-es2015/
Arrows
var plus = (x, y) => { return x + y; };
Classes
class Human {
constructor(name) { this.name = name; }
}
Array Spread
function f(x, ...y) {
return x * y.length;
}
f(3, "hello", true) == 6
8. • Array Map, Filter, Reduce (Functional Programming)
Better code part3
Map Filter Reduce
Array Map, Filter and Reduce in JS | Aten Design Group http://atendesigngroup.com/blog/array-map-filter-and-reduce-js
12. Solutions
• var x = (0.2 * 10 + 0.1 * 10) / 10;
• use math.js library http://mathjs.org/index.html
13. Javascript data types
• Six data types that are primitives:
• Boolean
• Null
• Undefined
• Number
• String
• Symbol (new in ECMAScript 6)
• and Object
14. What is type of Date?
typeof( Date.now() );
Numbers(Unix Timestamp)
ex) 1472635026140