20160311 Elantris
Note: https://hackmd.io/s/N1ERJm5Ux
2016
ntuosc
javascript
Browser
Editor
Node.js
Create a folder and install node modules
Packages
react
react-dom
babelify
babel-preset-react
moment
Define Function
Call Function
Pass Parameter
Everything in JavaScript is Object.
All Types of variables extend Object
Use typeof
to check the type of object
Define an object
Get values of objects
Iterate an object
output
Pass a Function object as parameters
Anonymous Function
Define an anonymous function and call immediately
JavaScript Object Notation
true
or false
123
""
[]
{}
Usage
Usage
JavaScript module in two formats
AMD
Implement: Require.js
CommonJS
Implement: Node.js
Example of CommonJS
getRandomInt.js
operation.js
myScript.js
File Type: JSX (JSX in Depth)
JavaScript with XML
Use npm
Install Packages
Bundle Main File
Component Specifications
function
function
object
array
object
function
Lifecycle Methods
Example