Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Enrollment No.

: 202103103510120

Practical 1
Aim: Create a “Hello World” Program using the ES6 arrow function in React.

Solution :
<!DOCTYPE html>
<html lang="en">

<body>
<h1>Arrow Function</h1>
<p id="arrow"></p>
<p id="function"></p>

<script>
world = function()
{
return "Hello World"
}
document.getElementById("function").innerHTML = world();
hello = () => {
return "Hello World"
}
document.getElementById("arrow").innerHTML = hello();
</script>

</body>
</html>

Output :

CGPIT/AIDS/SEM-6/Full Stack Development 1


Enrollment No.: 202103103510120

Practical 3
Aim: Implement “Hello World” Program in node.js.

Solution :
const http = require('http');

const PORT = 8080;


const HOST = '192.168.198.30';

const server = http.createServer((req, res) => {


res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello, World!\n');
});

server.listen(PORT, HOST, () => {


console.log(`Congratuations Server running at\n http://${HOST}:${PORT}/`);
});

Output :

CGPIT/AIDS/SEM-6/Full Stack Development 2

You might also like