SlideShare a Scribd company logo
Basics of
JavaScript
Introduction
The World's Most Misunderstood Programming Language
- Has nothing to do with JAVA
- Object Oriented and Functional [Lisp in C’s clothing ]
- Designed as a scripting language for NetScape Navigator
- Traditionally abused for Form validation
- Now runs giants like walmart / paypal / linkedin
Introduction
JavaScript is a prototype-based
scripting language with dynamic typing
and first-class functions.
This makes it a mix of features makes it
a multi-paradigm language, supporting
object-oriented, imperative, and
functional programming styles.
Originally designed for the browser . But
now used literally everywhere.
History
- Created in 1995 by Brenden Eich
- First version was created in 10 days !
- Microsoft releases JScript for IE after few months
- Netscape goes to ECMA for getting standards
- First formal standards released in 1999 as ECMAScript 3- Has been
stable ever since
- Second coming happened after Google popularised concept of AJAX for
their web apps.
- Latest version (ES6) released last month with a lot of new features -
Classes , generators etc
- Google/Mozilla working on a project to make assembly in web possible.
(ASM.js / WebAssembly)
- Today its the most popular programming language on Github
Who uses JS?
In the Browser
Everyone who has a modern webpage/web app.
Best examples can be Google products.
And literally every website that you can think of.
Desktop
Windows 8 metro UI was built using it .
iOS uses a webkit engine for the great UI . Same
thing that is used by chrome for rendering.
Who uses JS?
Server Side
Walmart.com,Paypal,Linked in, Apple were early adopters.
Now most companies are moving to node / something
similar for their content serving
IOT - JS is becoming the go to language
RealTime - We are launching chat soon built fully in node
What can JS do today ?
- Run a VM inside a browser
- Run a game inside the browser
- Serve 300 million users without
shooting up the CPU
- Help in making PPTs online
- Make real time chat possible
Atwood's Law:
“any application that can be written in JavaScript, will
eventually be written in JavaScript.”
What can JS do ?
- Make cool graphics
- Make sophisticated dashboards
- Car dashboard panels
- and of course validation
Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types
Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Numbers
- Double-precision 64-bit format [ Int and floats]
- Leads to problems this
0.1 + 0.2 == 0.30000000000000004
- All standard arithmetic operators ( + , - , * , / , % )
- Math Object , Math.sin() , Math.round() , Math.floor() etc
- parseInt() , parseFloat() for parsing string to numbers
- Special Numbers - NaN , Infinity
String
- Sequences of 16 bit Unicode chars . It will support any language . ह द , ಕನ ಡ
- String has a lot of built in functions, properties . DEMO
Boolean
- Coerce any thing into Boolean using Boolean()
- Falsy Values :false, 0, “”,NaN, null, and undefined
- Truthy Values: Everything else
Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Declaring a variable
var a;
var b = 10;
b = “Hello World”
console.log(a) // Would show undefined - Means its declared but not defined
null
Is an assignment value.
Can be used for explicitly saying at a point of execution that variable is not available or
doesn't have an actual value.
null absence of value for a variable;
undefined absence of variable itself;
Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Object
- Most important part of JS .Everything is an object in JS . Even Functions
- Simple collections of name-value pairs
- Primitives are immutable
var obj = new Object();
var obj = {};
function Person(name, age) {
this.name = name;
this.age = age;
}
var p1= new Person("John Doe", 24);
TIP: All object assignments are References . i.e when you do
var p2 = p1 // This will point to same place in memory
Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Functions
- First class citizens
function add(x, y) {
var total = x + y;
return total;
}
This that you can do :
add(3,4) // will return 7
add(“hello”,”world”) // will return “helloworld”
add(3,4,5) // ??
add(3) // ??
add() // ??
All functions will have access to special parameters
inside its body like arguments , this etc.
var add = function(x, y) {
var total = x + y;
return total;
}
Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Arrays [ ]
- Special type of Objects.
- Has a special property called length
- length is not the number of elements of array
- It is one more than highest index in the array
var arr = new Array();
arr[0] = 1; // Arrays dont have a type. You have have
arr[1] = ‘b’; // primitives or objects as array elements
arr[50] = new Object();
arr[99] = true;
console.log(arr.length) // Length would be 100 when actually there
// are only 4 elements in the array
Language fundamentals
● Number
● String
● Boolean
● null
● undefined
● Object
○ Function
○ Array
○ Date
○ RegExp
Data Types Date
- Exact replica of Java date class.
- new Date() gives you the timestamp accurate to milliseconds from 1/1/1970
- new Date(10-1-2015) gives you a date object with that days timestamp
- Lots of date manipulation functions inbuilt. Also lots of good i18n functions
Regular Expressions
- One of the least exploited parts of JS.
- Good for form validation .
- Can be used along with String.replace method
Flow Control
Support for almost every flow control structure.
Including :
if then else
while
for
ternary operator
switch case
for in
break
continue
Error Handling
Best way to handle errors is to write good code.
Next best way is to use try catches
try {
Block of code to try
}
catch(err) {
Block of code to handle errors
}
This ensures that rest of the code continues to execute . Otherwise
your code will stop executing at the line where the error occurred .
Leading to total disaster.
Debugging
F12
Lets talk about the DOM
Document Object Model exposes many APIs to mess with its
Objects.
eg : getElementByID(“id”) , getElementsByClassName().
By using / misusing the APIs we can bring magic/disaster to web
pages.
DOM Manipulation
DOM Manipulation is slow. Depends based on the browser /OS/
System resources and implementation of DOM. After each
manipulation depending on what changes you made , browser has to
do a rerender / repaint.
Over to JSBin
Sync Vs Async
- Synchronous code runs line by line
- Async code runs parallely
- DEMO
Hoisting
Variable Hoisting
var declaredLater;
// Outputs: undefined
console.log(declaredLater);
declaredLater = "Now it's defined!";
// Outputs: "Now it's defined!"
console.log(declaredLater);
Function Hoisting
// Outputs: "Definition hoisted!"
definitionHoisted();
// TypeError: undefined is not a function
definitionNotHoisted();
function definitionHoisted() {
console.log("Definition hoisted!");
}
var definitionNotHoisted = function () {
console.log("Definition not hoisted!");
};
JSON
- Universal Data exchange format of web
- Invented initially for representing JS objects
- Supports all the basic data types
Scope
Scope is the set of variables you have access to.
In JS there are mainly two scopes
1) Local Scope
2) Global Scope
3) Automatic Global
Any variable declared inside a function using var has local
scope
Any variable declared outside it has global scope
Special Case : Any variable declared inside a function without
the “var“ keyword is assumed global and is assinged to global
scope.
function foo(){
var a =10; // Local scope
}
var b = 100; // Global scope
function bar(){
c = 10; // Automatic global
}
AJAX
AJAX - Asynchronous JavaScript and
XML.
Something that microsoft did right :P
AJAX is the art of exchanging data with a
server, and updating parts of a web page
- without reloading the whole page.
Implemented using the XMLHttpRequest
abstracted in jQuery using $.ajax({})
JS on the Server
Whats wrong with our servers ?
JS on the Server
How does node.js help ?
JS on the Server
Setting up a server using Node
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Worldn');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
JS on the Server
Setting up a server using Node
Thankyou !
Questions ?

More Related Content

What's hot (20)

PPT
Java Script ppt
Priya Goyal
 
PDF
Javascript essentials
Bedis ElAchèche
 
PDF
JavaScript - Chapter 11 - Events
WebStackAcademy
 
PDF
javascript objects
Vijay Kalyan
 
PPTX
Event In JavaScript
ShahDhruv21
 
PDF
Javascript
Momentum Design Lab
 
PPTX
jQuery
Jay Poojara
 
PDF
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
PPT
Javascript Basics
Vishal Mittal
 
PPT
JavaScript - An Introduction
Manvendra Singh
 
PDF
JavaScript - Chapter 6 - Basic Functions
WebStackAcademy
 
PDF
An introduction to React.js
Emanuele DelBono
 
PPT
Advanced Javascript
Adieu
 
PDF
Introduction to web programming with JavaScript
T11 Sessions
 
PPTX
SQLite database in android
Gourav Kumar Saini
 
PDF
jQuery for beginners
Arulmurugan Rajaraman
 
PPT
Introduction to JavaScript
Andres Baravalle
 
PPTX
Js: master prototypes
Barak Drechsler
 
PDF
Asynchronous JavaScript Programming with Callbacks & Promises
Hùng Nguyễn Huy
 
PDF
3. Java Script
Jalpesh Vasa
 
Java Script ppt
Priya Goyal
 
Javascript essentials
Bedis ElAchèche
 
JavaScript - Chapter 11 - Events
WebStackAcademy
 
javascript objects
Vijay Kalyan
 
Event In JavaScript
ShahDhruv21
 
jQuery
Jay Poojara
 
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
Javascript Basics
Vishal Mittal
 
JavaScript - An Introduction
Manvendra Singh
 
JavaScript - Chapter 6 - Basic Functions
WebStackAcademy
 
An introduction to React.js
Emanuele DelBono
 
Advanced Javascript
Adieu
 
Introduction to web programming with JavaScript
T11 Sessions
 
SQLite database in android
Gourav Kumar Saini
 
jQuery for beginners
Arulmurugan Rajaraman
 
Introduction to JavaScript
Andres Baravalle
 
Js: master prototypes
Barak Drechsler
 
Asynchronous JavaScript Programming with Callbacks & Promises
Hùng Nguyễn Huy
 
3. Java Script
Jalpesh Vasa
 

Similar to Basics of JavaScript (20)

PPT
React native
Mohammed El Rafie Tarabay
 
PPTX
oojs
Imran shaikh
 
PPT
Ajax and JavaScript Bootcamp
AndreCharland
 
PPTX
Getting started with typescript
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
PDF
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
jeffz
 
PDF
Beyond Breakpoints: A Tour of Dynamic Analysis
C4Media
 
PDF
JavaScript for real men
Ivano Malavolta
 
PDF
JavaScript
Ivano Malavolta
 
PDF
JavaScript Interview Questions PDF By ScholarHat
Scholarhat
 
PDF
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
Codemotion
 
PPTX
Developer’s viewpoint on swift programming language
Azilen Technologies Pvt. Ltd.
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
[2015/2016] JavaScript
Ivano Malavolta
 
PDF
Javascript
20261A05H0SRIKAKULAS
 
PPTX
JavaScript Basics - GameCraft Training
Radoslav Georgiev
 
PPTX
JavaScript (without DOM)
Piyush Katariya
 
PPTX
Oojs 1.1
Rodica Dada
 
PPTX
Lecture 4- Javascript Function presentation
GomathiUdai
 
PDF
JavaScript(Es5) Interview Questions & Answers
Ratnala Charan kumar
 
Ajax and JavaScript Bootcamp
AndreCharland
 
Getting started with typescript
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
jeffz
 
Beyond Breakpoints: A Tour of Dynamic Analysis
C4Media
 
JavaScript for real men
Ivano Malavolta
 
JavaScript
Ivano Malavolta
 
JavaScript Interview Questions PDF By ScholarHat
Scholarhat
 
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
Codemotion
 
Developer’s viewpoint on swift programming language
Azilen Technologies Pvt. Ltd.
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
[2015/2016] JavaScript
Ivano Malavolta
 
JavaScript Basics - GameCraft Training
Radoslav Georgiev
 
JavaScript (without DOM)
Piyush Katariya
 
Oojs 1.1
Rodica Dada
 
Lecture 4- Javascript Function presentation
GomathiUdai
 
JavaScript(Es5) Interview Questions & Answers
Ratnala Charan kumar
 
Ad

Recently uploaded (20)

PPTX
Using Google Data Studio (Looker Studio) to Create Effective and Easy Data Re...
Orage Technologies
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Lecture A - AI Workflows for Banking.pdf
Dr. LAM Yat-fai (林日辉)
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Per Axbom: The spectacular lies of maps
Nexer Digital
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
Earn Agentblazer Status with Slack Community Patna.pptx
SanjeetMishra29
 
PDF
SalesForce Managed Services Benefits (1).pdf
TechForce Services
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PPTX
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PDF
Basics of Electronics for IOT(actuators ,microcontroller etc..)
arnavmanesh
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Using Google Data Studio (Looker Studio) to Create Effective and Easy Data Re...
Orage Technologies
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Lecture A - AI Workflows for Banking.pdf
Dr. LAM Yat-fai (林日辉)
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Per Axbom: The spectacular lies of maps
Nexer Digital
 
The Future of Artificial Intelligence (AI)
Mukul
 
Earn Agentblazer Status with Slack Community Patna.pptx
SanjeetMishra29
 
SalesForce Managed Services Benefits (1).pdf
TechForce Services
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
Basics of Electronics for IOT(actuators ,microcontroller etc..)
arnavmanesh
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Ad

Basics of JavaScript

  • 2. Introduction The World's Most Misunderstood Programming Language - Has nothing to do with JAVA - Object Oriented and Functional [Lisp in C’s clothing ] - Designed as a scripting language for NetScape Navigator - Traditionally abused for Form validation - Now runs giants like walmart / paypal / linkedin
  • 3. Introduction JavaScript is a prototype-based scripting language with dynamic typing and first-class functions. This makes it a mix of features makes it a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles. Originally designed for the browser . But now used literally everywhere.
  • 4. History - Created in 1995 by Brenden Eich - First version was created in 10 days ! - Microsoft releases JScript for IE after few months - Netscape goes to ECMA for getting standards - First formal standards released in 1999 as ECMAScript 3- Has been stable ever since - Second coming happened after Google popularised concept of AJAX for their web apps. - Latest version (ES6) released last month with a lot of new features - Classes , generators etc - Google/Mozilla working on a project to make assembly in web possible. (ASM.js / WebAssembly) - Today its the most popular programming language on Github
  • 5. Who uses JS? In the Browser Everyone who has a modern webpage/web app. Best examples can be Google products. And literally every website that you can think of. Desktop Windows 8 metro UI was built using it . iOS uses a webkit engine for the great UI . Same thing that is used by chrome for rendering.
  • 6. Who uses JS? Server Side Walmart.com,Paypal,Linked in, Apple were early adopters. Now most companies are moving to node / something similar for their content serving IOT - JS is becoming the go to language RealTime - We are launching chat soon built fully in node
  • 7. What can JS do today ? - Run a VM inside a browser - Run a game inside the browser - Serve 300 million users without shooting up the CPU - Help in making PPTs online - Make real time chat possible Atwood's Law: “any application that can be written in JavaScript, will eventually be written in JavaScript.”
  • 8. What can JS do ? - Make cool graphics - Make sophisticated dashboards - Car dashboard panels - and of course validation
  • 9. Language fundamentals ● Number ● String ● Boolean ● null ● undefined ● Object ○ Function ○ Array ○ Date ○ RegExp Data Types
  • 10. Language fundamentals ● Number ● String ● Boolean ● null ● undefined ● Object ○ Function ○ Array ○ Date ○ RegExp Data Types Numbers - Double-precision 64-bit format [ Int and floats] - Leads to problems this 0.1 + 0.2 == 0.30000000000000004 - All standard arithmetic operators ( + , - , * , / , % ) - Math Object , Math.sin() , Math.round() , Math.floor() etc - parseInt() , parseFloat() for parsing string to numbers - Special Numbers - NaN , Infinity String - Sequences of 16 bit Unicode chars . It will support any language . ह द , ಕನ ಡ - String has a lot of built in functions, properties . DEMO Boolean - Coerce any thing into Boolean using Boolean() - Falsy Values :false, 0, “”,NaN, null, and undefined - Truthy Values: Everything else
  • 11. Language fundamentals ● Number ● String ● Boolean ● null ● undefined ● Object ○ Function ○ Array ○ Date ○ RegExp Data Types Declaring a variable var a; var b = 10; b = “Hello World” console.log(a) // Would show undefined - Means its declared but not defined null Is an assignment value. Can be used for explicitly saying at a point of execution that variable is not available or doesn't have an actual value. null absence of value for a variable; undefined absence of variable itself;
  • 12. Language fundamentals ● Number ● String ● Boolean ● null ● undefined ● Object ○ Function ○ Array ○ Date ○ RegExp Data Types Object - Most important part of JS .Everything is an object in JS . Even Functions - Simple collections of name-value pairs - Primitives are immutable var obj = new Object(); var obj = {}; function Person(name, age) { this.name = name; this.age = age; } var p1= new Person("John Doe", 24); TIP: All object assignments are References . i.e when you do var p2 = p1 // This will point to same place in memory
  • 13. Language fundamentals ● Number ● String ● Boolean ● null ● undefined ● Object ○ Function ○ Array ○ Date ○ RegExp Data Types Functions - First class citizens function add(x, y) { var total = x + y; return total; } This that you can do : add(3,4) // will return 7 add(“hello”,”world”) // will return “helloworld” add(3,4,5) // ?? add(3) // ?? add() // ?? All functions will have access to special parameters inside its body like arguments , this etc. var add = function(x, y) { var total = x + y; return total; }
  • 14. Language fundamentals ● Number ● String ● Boolean ● null ● undefined ● Object ○ Function ○ Array ○ Date ○ RegExp Data Types Arrays [ ] - Special type of Objects. - Has a special property called length - length is not the number of elements of array - It is one more than highest index in the array var arr = new Array(); arr[0] = 1; // Arrays dont have a type. You have have arr[1] = ‘b’; // primitives or objects as array elements arr[50] = new Object(); arr[99] = true; console.log(arr.length) // Length would be 100 when actually there // are only 4 elements in the array
  • 15. Language fundamentals ● Number ● String ● Boolean ● null ● undefined ● Object ○ Function ○ Array ○ Date ○ RegExp Data Types Date - Exact replica of Java date class. - new Date() gives you the timestamp accurate to milliseconds from 1/1/1970 - new Date(10-1-2015) gives you a date object with that days timestamp - Lots of date manipulation functions inbuilt. Also lots of good i18n functions Regular Expressions - One of the least exploited parts of JS. - Good for form validation . - Can be used along with String.replace method
  • 16. Flow Control Support for almost every flow control structure. Including : if then else while for ternary operator switch case for in break continue
  • 17. Error Handling Best way to handle errors is to write good code. Next best way is to use try catches try { Block of code to try } catch(err) { Block of code to handle errors } This ensures that rest of the code continues to execute . Otherwise your code will stop executing at the line where the error occurred . Leading to total disaster.
  • 19. Lets talk about the DOM Document Object Model exposes many APIs to mess with its Objects. eg : getElementByID(“id”) , getElementsByClassName(). By using / misusing the APIs we can bring magic/disaster to web pages. DOM Manipulation DOM Manipulation is slow. Depends based on the browser /OS/ System resources and implementation of DOM. After each manipulation depending on what changes you made , browser has to do a rerender / repaint. Over to JSBin
  • 20. Sync Vs Async - Synchronous code runs line by line - Async code runs parallely - DEMO
  • 21. Hoisting Variable Hoisting var declaredLater; // Outputs: undefined console.log(declaredLater); declaredLater = "Now it's defined!"; // Outputs: "Now it's defined!" console.log(declaredLater); Function Hoisting // Outputs: "Definition hoisted!" definitionHoisted(); // TypeError: undefined is not a function definitionNotHoisted(); function definitionHoisted() { console.log("Definition hoisted!"); } var definitionNotHoisted = function () { console.log("Definition not hoisted!"); };
  • 22. JSON - Universal Data exchange format of web - Invented initially for representing JS objects - Supports all the basic data types
  • 23. Scope Scope is the set of variables you have access to. In JS there are mainly two scopes 1) Local Scope 2) Global Scope 3) Automatic Global Any variable declared inside a function using var has local scope Any variable declared outside it has global scope Special Case : Any variable declared inside a function without the “var“ keyword is assumed global and is assinged to global scope. function foo(){ var a =10; // Local scope } var b = 100; // Global scope function bar(){ c = 10; // Automatic global }
  • 24. AJAX AJAX - Asynchronous JavaScript and XML. Something that microsoft did right :P AJAX is the art of exchanging data with a server, and updating parts of a web page - without reloading the whole page. Implemented using the XMLHttpRequest abstracted in jQuery using $.ajax({})
  • 25. JS on the Server Whats wrong with our servers ?
  • 26. JS on the Server How does node.js help ?
  • 27. JS on the Server Setting up a server using Node var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');
  • 28. JS on the Server Setting up a server using Node