- three kinds of error
- there are
- syntax error which means you write a wrong grammer, break the rule of the language. For example: missing a curly bracket
- compile error often happened in static type language which means the code cannot be translated into machine language
- run time happened in the stage of
- 💡 [[TypeScript]] is the static type version of Javascript, which can catch the error in the early compile stage and avoid to leave it until run which is too late / improve code maintainbility
## Javascript
- What is the difference between double equals == and triple equals === ?
- double equals are loose and automatically convert the value to a common type before making a comparison(Which is called type coercion), so if the value are the same, double equals won't care about the type
- while triple equals is strict which means both the value and type must be the same
- always use triple equals
- What's the difference between a JavaScript variable that is: `null`, `undefined` or undeclared?
- null:
## React
- [[framework vs library]]
- the key difference is ==control flow==
- in library, I am in control and only call the function offered by library when I need it. library is like a tool to help me solve the specific problems.
- in framework, it takes the control and I need to follow the pattern offered by framework. framework is like a blueprint that I build upon.
- for example
- [[public/CODE/React|React]] consider as a library and I just import and call the functions.
- which [[Express.js]] considered as a framework offered a complete pattern and solution build on node.js