JS Advance
Advance JS
構造函數constructor Function
1 | function createCard(initName){ |
output
createCard { name: ‘Ma’ }
createCard { name: ‘Ma2’ }
createCard { name: ‘Ma3’ }
array function =>
In ES6 there is a new function called array function, which you can write shorter function.
Before ES6
function hello(){}
after ES6
let hello = function (){}
shorthand
let hello = () =>{}
function without passing paramter
Before ES6 (normal function)
ex: function hello(){}