Academic Session 2025-26
ODD Semester Jul-Dec 2025
UNIVERSITY INSTITUTE OF ENGINEERING
APEX INSTITUTE OF TECHNOLOGY
B.E CSE/ Cloud Computing & DevOps
(5th Semester)
MICROSERVICES ARCHITECTURE & ITS IMPLEMNTATION
(23CSH-331)
Unit No. 1 Chapter No. 2 Lecture No. 5
Topic : HTML & Java Script Basics
Dr.Amardeep Singh(E17149) Professor
MICROSERVICES ARCHITECTURE & ITS IMPLEMNTATION :
COURSE OBJECTIVES
The Course aims to:
1. Understand the value proposition and technical aspects of microservices.
2. Comprehend the need for microservices and its evolution.
3. Demonstrate use of appropriate containers and microservices for
developing and deploying applications with cloud.
4. Analyze the need of microservices
5. Develop, test and analyze a Microservice.
APEX INSTITUTE OF TECHNOLOGY 2
UNIVERSITY INSTITUTE OF ENGINEERING
COURSE OUTCOMES
On completion of this course, the students shall be able to:-
CO1 Define and differentiate between various Microservices Architectural styles.
CO2 Demonstrate various strategies available for microservices decision making.
CO3 Describe the technical aspects of microservices.
CO4 Explain the use functions for microservices.
CO5 Analyze the microservices for developing and deploying applications with cloud.
APEX INSTITUTE OF TECHNOLOGY 3
UNIVERSITY INSTITUTE OF ENGINEERING
Unit-1 Syllabus
Unit-1 HTML and JavaScript Basics
Chapter-1 HTML and CSS, Client Server Architecture,
JavaScript Basics, Nature of JavaScript language,
Understand JavaScript primitive types.
JavaScript Objects: - Java Script Array, Date and Error Objects types, Understand Java Script Array
Objects, Understand Java Script Date Objects, Understand Java Script Error Objects.
Chapter-2 Java Script Variables and Control Statements: - JavaScript Variables and different Control
Statements, understand how to define JavaScript Variables, Work Java Script If statements, Work
Java Script switch statements, Work Java Script for and while loop statements
JavaScript Functions: -introduces JavaScript Functions, declare a JavaScript function, creating
custom objects with functions, adding functions to prototypes, Self-executing functions.
Chapter-3 Client-Side Java Script: -JavaScript is used with HTML and the Document Object Model i.e DOM,
Understand Scripts in HTML documents, Describe the document object model (DOM) hierarchy,
Overview of the DOM specification levels, Describe the window and document objects, Accessing
document elements.
APEX INSTITUTE OF TECHNOLOGY 4
UNIVERSITY INSTITUTE OF ENGINEERING
SUGGESTIVE READINGS
TEXT BOOKS:
T1 Sam Newman, Building Micro-services: Designing Fine-Grained Systems 1st Edition, O'Reilly, 2015.
T2 Eberhard Wolff, Microservices - A Practical Guide Principles, Concepts, and Recipes, 2018.
REFERENCE BOOKS:
R1 Sam Newman, Building Micro-services: Designing Fine-Grained Systems 1st Edition, O'Reilly, 2015.
APEX INSTITUTE OF TECHNOLOGY 5
UNIVERSITY INSTITUTE OF ENGINEERING
Learning Outcome of this lecture
Unit Name Outcome
I HTML and Java Script Variables and Control Statements
JavaScript Basics • Java Script variables
• Understanding how to define JavaScript variables
• Different Control statements:
• Work Java Script If statements
• Work Java Script switch statements
• Work Java Script for and while loop statements
The course outcome of this lecture is to explain the variables in JavaScript (CO1)
APEX INSTITUTE OF TECHNOLOGY 6
UNIVERSITY INSTITUTE OF ENGINEERING
Topic of today
Variables in Java Script Statements in Java Script
• Java Script variables
• Understanding how to define JavaScript variables
• Different Control statements:
o Work Java Script If statements
o Work Java Script switch statements
o Work Java Script for and while loop statements
APEX INSTITUTE OF TECHNOLOGY 7
UNIVERSITY INSTITUTE OF ENGINEERING
Variables & Statements in JavaScript
Variables in JavaScript
•Variables are named containers used to store data.
•Declared using:
•var – Function scope (legacy)
•let – Block scope (preferred)
•const – Block scope, cannot be reassigned
Examples:
let name = "John";
const pi = 3.14;
var count = 5;
Statements in JavaScript
•A statement is a complete instruction to perform an action.
•JavaScript executes statements line by line.
•Common types:
•Declaration: let x = 10;
•Assignment: x = 20;
•Conditional: if, else
•Loops: for, while
•Statements typically end with a semicolon (;).
Variables hold data. Statements define actions. Together, they build logic in JavaScript.
APEX INSTITUTE OF TECHNOLOGY 8
UNIVERSITY INSTITUTE OF ENGINEERING
Variables & Statements in JavaScript
1. JavaScript Variables 2. JavaScript Statements
•Used to store data values •Instructions that are executed by the browser
•Declared using: •End with semicolon (;) (optional but
•var – function-scoped (older) recommended)
•let – block-scoped (modern, preferred) •Types of statements:
•const – block-scoped, cannot be reassigned •Declaration: let x = 5;
javascript •Assignment: x = 10;
let name = "Alice"; •Conditional: if (x > 5) { ... }
const age = 25; •Loop: for (let i = 0; i < 5; i++) { ... }
var city = "Delhi";
APEX INSTITUTE OF TECHNOLOGY 9
UNIVERSITY INSTITUTE OF ENGINEERING
Variables & Statements in JavaScript
3. Live Demonstration Example Key Takeaways
javascript •Use let and const for modern JS coding
let score = 90; •JavaScript is case-sensitive
if (score > 80) { •Statements control the logic flow
console.log("Excellent performance!"); •Variables are containers for data
} else {
console.log("Keep trying!");
}
APEX INSTITUTE OF TECHNOLOGY 10
UNIVERSITY INSTITUTE OF ENGINEERING
JavaScript Variables
Introduction to JavaScript Variables
• Variables are used to store data values in JavaScript.
• They act as containers for holding information.
• JavaScript is a loosely typed language, meaning variables can hold any
data type.
• Variable names are case-sensitive and must follow naming rules (no
spaces, can't start with a number).
APEX INSTITUTE OF TECHNOLOGY 11
UNIVERSITY INSTITUTE OF ENGINEERING
JavaScript Variables
Declaring Variables – The Basics
•JavaScript provides three keywords to declare variables:
•var – Function-scoped (older, less preferred)
•let – Block-scoped (modern and flexible)
•const – Block-scoped and constant (value can't be reassigned)
Syntax Example:
javascript
let name = "Alice";
const age = 25;
var city = "Delhi";
APEX INSTITUTE OF TECHNOLOGY 12
UNIVERSITY INSTITUTE OF ENGINEERING
JavaScript Variables
Understanding var, let, and const
•var:
•Function-scoped
•Can be re-declared and updated
•Can cause unexpected behavior in modern code
•let:
•Block-scoped
•Can be updated but not re-declared in the same scope
•Recommended for reassignable variables
•const:
•Block-scoped
•Cannot be updated or re-declared
•Use for fixed values
APEX INSTITUTE OF TECHNOLOGY 13
UNIVERSITY INSTITUTE OF ENGINEERING
JavaScript Variables
Rules for Naming Variables:
•Names must start with a letter, $, or _
•Cannot start with a number
•No spaces or special characters allowed
•Case-sensitive: Name, name, and NAME are different
•Use camelCase for naming variables (userName, totalMarks) )
APEX INSTITUTE OF TECHNOLOGY 14
UNIVERSITY INSTITUTE OF ENGINEERING
JavaScript Variables
Best Practices in Defining Variables
•Use let and const instead of var in modern code
•Prefer const unless the variable needs to change
•Declare variables at the top of their scope
•Give meaningful names (avoid x, y, temp)
•Initialize variables while declaring to avoid undefined issues
APEX INSTITUTE OF TECHNOLOGY 15
UNIVERSITY INSTITUTE OF ENGINEERING
Different Control Statements in JavaScript
Introduction to Control Statements
•Control statements alter the flow of program execution based on
conditions or loops.
•JavaScript supports:
•Conditional statements: if, else if, else, switch
•Looping statements: for, while, do...while
•These are used to make decisions and repeat tasks.
APEX INSTITUTE OF TECHNOLOGY 16
UNIVERSITY INSTITUTE OF ENGINEERING
Different Control Statements in JavaScript
Working with if, else if, and else Statements
•Used to execute code blocks based on conditions.
Syntax:
if (condition) {
// code if condition is true
} else if (anotherCondition) {
// code if another condition is true
} else {
// code if all conditions are false
}
•Conditions must return true or false.
Example:
let age = 18;
if (age >= 18) {
console.log("Eligible to vote");
} else {
console.log("Not eligible");
} APEX INSTITUTE OF TECHNOLOGY 17
UNIVERSITY INSTITUTE OF ENGINEERING
Different Control Statements in JavaScript
Working with switch Statements
•The switch statement is used to test multiple conditions more efficiently than many if-else blocks.
Syntax:
switch(expression) {
case value1:
// code block
break;
case value2:
// code block
break;
default:
// default block
}
Example:
let day = 2;
switch(day) {
case 1: console.log("Monday"); break;
case 2: console.log("Tuesday"); break;
default: console.log("Other day");
} APEX INSTITUTE OF TECHNOLOGY 18
UNIVERSITY INSTITUTE OF ENGINEERING
Different Control Statements in JavaScript
Working with for Loop
Used when the number of iterations is known.
Syntax:
for (initialization; condition; increment) {
// code block
}
Best for count-controlled loops.
Example:
for (let i = 0; i < 5; i++) {
console.log("i =", i);
}
APEX INSTITUTE OF TECHNOLOGY 19
UNIVERSITY INSTITUTE OF ENGINEERING
Different Control Statements in JavaScript
Working with while and do..while Loops
•while loop: Executes as long as condition is true.
•do...while loop: Executes the block at least once, even if condition is false.
Syntax:
while (condition) {
// code block
}
do {
// code block
} while (condition);
Example:
let count = 0;
while (count < 3) {
console.log(count);
count++;
} APEX INSTITUTE OF TECHNOLOGY 20
UNIVERSITY INSTITUTE OF ENGINEERING
Summary of the lecture
Variables in Java Script Statements in Java Script
• Learn about the Java Script Variables
• Learn about how to define JavaScript variables
• Learn about the Different Control statements:
oIf statements with examples.
oSwitch statements.
oFor.
owhile loop statements
APEX INSTITUTE OF TECHNOLOGY 21
UNIVERSITY INSTITUTE OF ENGINEERING
Practice & Discussion
•What is a variable in JavaScript and why is it used?
(Prompt discussion on storing and manipulating data in programs)
•What are the different ways to declare a variable in JavaScript?
Example: var, let, and const
•What is the difference between let, const, and var?
(Discuss scope, reassignment, and hoisting)
•Can you give an example of declaring and using a variable?
Example: let name = "John"; console.log(name);
APEX INSTITUTE OF TECHNOLOGY 22
UNIVERSITY INSTITUTE OF ENGINEERING
Practice & Discussion
•How does an if statement work, and can you give an example?
Example: if (score > 50) { console.log("Pass"); }
•When would you use a switch statement instead of multiple if statements?
Example: switch(day) { case "Monday": console.log("Start of week"); break; }
•What is the basic structure of a for loop, and what is it used for?
Example: for(let i = 0; i < 5; i++) { console.log(i); }
•How does a while loop differ from a for loop, and when is it preferred?
Example: while(count < 5) { console.log(count); count++; }
APEX INSTITUTE OF TECHNOLOGY 23
UNIVERSITY INSTITUTE OF ENGINEERING
Questions of this Lecture
(Discussion Topics)
• Discuss the correct structure and syntax of a switch statement in JavaScript with a suitable example.
• Discuss the type of loop best suited for situations where the number of iterations is known in advance.
• Discuss the control structure used in JavaScript to repeatedly execute a block of code until a specified
condition becomes false.
• Discuss the application of if, switch, and for statements in JavaScript by writing simple example code for
each.
• Discuss the differences between for and while loops in JavaScript, including when to use each, supported
by logical explanations.
• Discuss how to use while and for loops in JavaScript by writing basic code to display numbers from 1 to 5.
• Discuss the execution flow of JavaScript if, for, and switch control statements using simple real-life logic-
based examples.
• Discuss how var, let, and const behave in JavaScript using examples that highlight their differences in
declaration, scope, and reassignment.
• Discuss the use of if, switch, and while statements in JavaScript by creating a program that checks a
student's grade and prints remarks, explaining how control flows through each structure.
• Discuss the differences between var, let, and const for variable declarations in JavaScript, focusing on their
scope and hoisting behavior with theoretical justification.
APEX INSTITUTE OF TECHNOLOGY 24
UNIVERSITY INSTITUTE OF ENGINEERING
REFERENCES
1. "Index of elements in html 4". w3. World Wide Web Consortium. December 24,
1999. Archived from the original on May 5, 2007. Retrieved April 8, 2007.
2. "CSS Flexible Box Layout Module Level 1". W3C. 19 November 2018. Archived from the
original on 19 October 2012. Retrieved 18 October 2012.
3. "Usage statistics of JavaScript as client-side programming language on
websites". w3techs.com. 2021-04-09. Archived from the original on 2022-02-13.
Retrieved 2021-04-09.
4. https://www.coursera.org/specializations/html-css-javascript-for-web-developers.
5. https://www.coursera.org/learn/introduction-html-css-javascript.
6. https://www.coursera.org/specializations/javascript-beginner
7. https://www.coursera.org/learn/javascript-programming-essentials.
8. https://www.coursera.org/learn/programming-with-javascript.
APEX INSTITUTE OF TECHNOLOGY 25
UNIVERSITY INSTITUTE OF ENGINEERING
E-Resources
1. https://www.mooc.org/blog/best-programming-languages-for-web-
development
2. https://en.wikipedia.org/wiki/CSS
3. https://en.wikipedia.org/wiki/HTML
4. https://en.wikipedia.org/wiki/JavaScript
APEX INSTITUTE OF TECHNOLOGY 26
UNIVERSITY INSTITUTE OF ENGINEERING
Student Feedback Form
Class Session Review
APEX INSTITUTE OF TECHNOLOGY
UNIVERSITY INSTITUTE OF ENGINEERING
12
Thank You
For queries
Email: [email protected]
APEX INSTITUTE OF TECHNOLOGY
UNIVERSITY INSTITUTE OF ENGINEERING