Hi All, Welcome back to NodeJS tutorial course. I hope you all have watched my previous sessions which explains introduction setup of nodejs, architecture , features, v8 engine , global objects live coding. If not, please find links below Node.js - Section 1 Introduction & Setup - https://youtu.be/HSUqB2SWPkw Node.js - Section 2 Architecture & Features - https://youtu.be/n1x2hW8baas Node.js - Section 3 V8 Engine & First Example - https://youtu.be/BwwRrySrKJ4 Nodejs - Section 4 Globals & Live Examples - https://youtu.be/Fuhd6pYhMRY Nodejs - Section 5 REPL Console - https://youtu.be/N-YTMCjJXHg Please do watch. In this video i am going to explain you all about nodejs basics like data types, object literals, functions, local and global scopes. Will also be showing live example on how to use them. Node.js supports JavaScript. So, JavaScript syntax on Node.js is similar to the browser's JavaScript syntax. Node.js is a cross-platform JavaScript runtime environment. It allows the creation of scalable Web servers without threading and networking tools using JavaScript and a collection of “modules” that handle various core functionalities. It can make console-based and web-based node.js applications. Priimitive types Datatypes: Node.js contains various types of data types similar to JavaScript. Loose Typing - Node.js supports loose typing, it means you don’t need to specify what type of information will be stored in a variable in advance. We use var keyword in Node.js to declare any type of variable. Examples are given below: Objects - Node.js objects are same as JavaScript objects i.e. the objects are similar to variable and it contains many values which are written as name : value pairs. Name and value are separated by colon and every pair is separated by comma. Functions -- Node.js functions are defined using function keyword then the name of the function and parameters which are passed in the function. In Node.js, we don’t have to specify datatypes for the parameters and check the number of arguments received. Node.js functions follow every rule which is there while writing JavaScript functions. String and String Functions: In Node.js we can make a variable as string by assigning a value either by using single (”) or double (“”) quotes and it contains many functions to manipulate to strings. Live examples for all the basic concepts are in video and you can watch the same Defaults to local------------- Node's JavaScript is different from browser's JavaScript when it comes to global scope. In the browser's JavaScript, variables declared without var keyword become global. In Node.js, everything becomes local by default. Access Global Scope-------------- In a browser, global scope is the window object. In Node.js, global object represents the global scope. To add something in global scope, you need to export it using export or module.export. The same way, import modules/object using require() function to access it from the global scope. For example, to export an object in Node.js, use exports.name = object. Now, you can import log object using require() function and use it anywhere in your Node.js project. Live coding-------- Last slide audio--- Now you all have good idea about nodejs basics, how it works, how to use in live coding and with majorly used examples, In next session i would be explaining about nodejs modules and few examples on the same. Thank you for watching, if you like my session please like, comment and subscribe to my channel. See you in next session!
Hi All, Welcome back to NodeJS tutorial course. I hope you all have watched my previous sessions which explains introduction setup of nodejs, architecture , features, v8 engine , global objects live coding. If not, please find links below Node.js - Section 1 Introduction & Setup - https://youtu.be/HSUqB2SWPkw Node.js - Section 2 Architecture & Features - https://youtu.be/n1x2hW8baas Node.js - Section 3 V8 Engine & First Example - https://youtu.be/BwwRrySrKJ4 Nodejs - Section 4 Globals & Live Examples - https://youtu.be/Fuhd6pYhMRY Nodejs - Section 5 REPL Console - https://youtu.be/N-YTMCjJXHg Please do watch. In this video i am going to explain you all about nodejs basics like data types, object literals, functions, local and global scopes. Will also be showing live example on how to use them. Node.js supports JavaScript. So, JavaScript syntax on Node.js is similar to the browser's JavaScript syntax. Node.js is a cross-platform JavaScript runtime environment. It allows the creation of scalable Web servers without threading and networking tools using JavaScript and a collection of “modules” that handle various core functionalities. It can make console-based and web-based node.js applications. Priimitive types Datatypes: Node.js contains various types of data types similar to JavaScript. Loose Typing - Node.js supports loose typing, it means you don’t need to specify what type of information will be stored in a variable in advance. We use var keyword in Node.js to declare any type of variable. Examples are given below: Objects - Node.js objects are same as JavaScript objects i.e. the objects are similar to variable and it contains many values which are written as name : value pairs. Name and value are separated by colon and every pair is separated by comma. Functions -- Node.js functions are defined using function keyword then the name of the function and parameters which are passed in the function. In Node.js, we don’t have to specify datatypes for the parameters and check the number of arguments received. Node.js functions follow every rule which is there while writing JavaScript functions. String and String Functions: In Node.js we can make a variable as string by assigning a value either by using single (”) or double (“”) quotes and it contains many functions to manipulate to strings. Live examples for all the basic concepts are in video and you can watch the same Defaults to local------------- Node's JavaScript is different from browser's JavaScript when it comes to global scope. In the browser's JavaScript, variables declared without var keyword become global. In Node.js, everything becomes local by default. Access Global Scope-------------- In a browser, global scope is the window object. In Node.js, global object represents the global scope. To add something in global scope, you need to export it using export or module.export. The same way, import modules/object using require() function to access it from the global scope. For example, to export an object in Node.js, use exports.name = object. Now, you can import log object using require() function and use it anywhere in your Node.js project. Live coding-------- Last slide audio--- Now you all have good idea about nodejs basics, how it works, how to use in live coding and with majorly used examples, In next session i would be explaining about nodejs modules and few examples on the same. Thank you for watching, if you like my session please like, comment and subscribe to my channel. See you in next session!