2. Browser and NodeJS are asynchronous, main thread in NodeJS is a single thread.
3. AngularJS: two way data binding
Execute and obey after master/boss give an order (Callback functions define the order that different actions occur, callback provides a level of control so you can determine the custom order)
Resolve “callback hell”, make it more clear and understandable.
(A promises holds the place of a value that does not exist yet, but will certainly exist in future)
Promises are a great way of giving clarity to consecutive asynchronous functions and clarifying inputs and outputs)
The key to promises is the concept of unfilled, filled or rejected. Once you create a sequence of these promises, you have a clear flow of inputs and outputs, and clear code for others to read. You can use 3 different states to track the progress of the entire chain of promises. The style is synchronous (sequential), even though the actual execution is asynchronous.
6. Promise All vs Race
Promise.all leads to a success when all conditions are met, or results in failure when one of the conditions fails (without waiting for the others).
Promise.race sets the program pending the outcome of the first condition tested in a list. Depending on whether the result is a success or a failure, promise.race is a success or a failure, without awaiting the result of other conditions.
Nodejs is built on Chrome V8 engine. (use the code)
10. At sign (@) before package name in npm package.json (refer link)
This is a new feature of NPM called ‘scoped packages’. They effectively allow NPM packages to be namespaced – any package that starts with
@angular/ will get grouped into a
@angular folder in your
The reason that scoped packages don’t show up in public search is because a lot of them are private packages created by organizations using NPM’s paid services, and they’re not comfortable opening the search up until they can be totally certain they’re not going to make anything public that shouldn’t be public – from a legal perspective, this is pretty understandable.
For more information, see the npm docs, or the angular docs
Donate $5 to me for a coffee with PayPal and read more professional and interesting technical blog articles about web and mobile development. Feel free to visit my web app, WhizWallet, to apply for credit, store or gift cards, DealsPlus to browse daily deals and store coupons to save money.
Follow me @Yaoli0615 at Twitter to get latest tech updates.