21 BasicsofNodeJS
21 BasicsofNodeJS
js:
Node is an open-source, Cross Platform, Java script runtime environment and used for executing Java
Script code outside web browser.
[Link] is a great web framework for beginners because it works great for data-intensive applications,
like streaming and real-time apps, and [Link] makes it easy to start building backend.
Capabilities of [Link] , it is used to build below Applications
- Build Application Logic
- Web Server
- Send Email
- DB lookups
- Automations
- Outputs
- Host Web Apps
Development tools:
BAS
VSCODE- Free tool provided by Microsoft. Its gives thousands of plug ins, makes of life of
developer is easy.
Download and install node js - [Link]
Test if its available
node -v
To test
node [Link]
Its case sensitive
Select the block of code, and use ctrl + / to comment the code
parseInt
[Link]("Hello [Link] by Sandeep");
var x = 10;// this will create variable x of type number
[Link](x);
[Link](typeof(x));
var y = "10";
[Link]('y is of type :' + typeof(y));
y = parseInt(y);
[Link]('y is of type :' + typeof(y));
z = false;
[Link]('z is of type :' + typeof(z));
// Working with objects, they are like structures in ABAP, contains multiple
fileds of different type
var oEmployee = {
"empId" : 123456,
"empName" : "Sandeep",
"salary": 5000,
"currency": "USD"
};
[Link]("A new object ------>" , oEmployee);
var complexJson = {
empTab : [],
cities : [],
gender : {}
};