0% found this document useful (0 votes)
16 views

MERN-Stack-with-GIT

Mern

Uploaded by

Rameshwar Poudel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

MERN-Stack-with-GIT

Mern

Uploaded by

Rameshwar Poudel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

MERN Stack with GIT – Day 1

• Development Setup:
The following tools must be installed on your laptops:
1. IDE: Visual Studio Code
2. Postman
3. Node LTS Version
4. Git
5. MongoDB Compass

• Extensions for VS Code:


Go to the extension menu in VS code, and download:
1. Code Runner
2. Live Server
Note: Go to settings, search for “Code Runner Terminal” and
turn this option ON:

Links for Downloading the tools:


VS Code Git
Postman Node LTS Version
MongoDB Compass (Scroll down and install .exe package)
Index.js

// 1. Functions:
// 1.1. Normal Function:
function add(a,b) {
console.log(a+b)
} OUTPUT:
add (6,9)
// 1.2. Arrow Function:
const add2 = (a,b) => {
console.log(a+b)
}
add2 (6,9)
const showName = (name) => {
console.log ("Hello"+" "+name)
}
showName ("World")
// 2. Arrays
const thisArray = [1, 2, 3, 4, 5]
for (let i=0; i<thisArray.length; i++) {
console.log(thisArray[i])
}
// Using JS methods
// 2.1. map
const newAr = thisArray.map(item => item*2)
console.log(newAr)
const filteredArray = thisArray.filter(item => item < 3)
console.log(filteredArray)
Index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<title>Document</title>
</head>
<body>
<div>
<h1 id="heading1">This is a static Heading1</h1>
<button id="btn">Click Me</button>
</div>
<script src="./Script.js"></script>
</body>
</html>
Script.js
alert("This is an alert !")
const heading1 = document.getElementById("heading1")
heading1.textContent = "This is a dynamic Heading1"
heading1.style.color = "purple"

const button = document.getElementById("btn")


button.onclick = function () {
alert("You Clicked Me !")
}

Get the Files from: HERE

You might also like