Template, layout and scope

 Templates:- Prewritten line of codes that a developer or programmer can modify according to his/her needs. The use of templates removes repetition saving a lot of time and making it easier for a developer to create a project.

Also, templates are blocks of codes which add feature and content to be render on the page.


Layout:- Layouts are files that define the structure of the page such as header, footer, navbar, sidebar, etc

Concept of scope:- generally there are two types of scope:

1.) Local: which can only be accessed inside the function they are declared in.

2.) Global: This can be accessed throughout the program.

Generally, all data types can be local as well as variable:

eg: if var, let, const, are declared inside a function they will be local, and if created outside the function they will be global, but if these three are declared in conditional or loop statements the let will behave differently than var, and const. Meaning in conditional and loop statements the let statement works as local instead of global data type.

Comments

Popular posts from this blog

To read data from database using mongo driver

To do list (without styling and css)