DuongPham's Blog

From my point of view

“use strict” in javascript

There are some quick notes of "use strict" in javascript:

"use strict":
– Is a string
– Define in the top of .js file or top of function
– If old browsers don’t support it, they will omit it

How to use?

  • Prevent assigning value to undefined variable

=> Comment the first line, run the code again & see there is no error

  • Prevent using let as a variable name
    • let  is a keyword  that used for block scope from ES 6
  • Don’t allow to delete variables, functions or arguments

  • Safer to use eval() function
    • eval() evaluates a javascript expression by providing a string  i.e. eval("var a = 2") <=> var a = 2;
    •  KEEP variables which are defined in eval function are only in eval’s scope

Demo Restaurant with Angular 2, 4

I did attend one of the best AngularJS (1.x) courses named Single Page Web Applications with AngularJS. At the end of this course, students have a chance to build a real project with AngularJS. This is a sample project.

I started working with Angular 2 for our project seven months ago. Angular is quite different from AngularJS. Therefore I want to build a similar website with Angular 2.

Repository in Github: https://github.com/thaiduongpham/demo-restaurant

Demo: https://thaiduongpham.github.io/demo-restaurant/


© 2019 DuongPham's Blog

Theme by Anders NorenUp ↑