Ip Odd Pratical
Ip Odd Pratical
<!DOCTYPE html>
<html>
<head>
<body>
<script>
////////////////////////////////////SIMPL
FUCTION///////////////////////////////////////////////////////////
//1
function test1()
{
return "1";
}
console.log(test1());
//2
function test2()
{
console.log("2")
}
test2();
//3
function test3(x, y = 1)
{
return x + y;
}
console.log (test3(2));
//4
function test4(x, y = 2)
{
console.log(x + y);
}
test4(2);
//////////////////////////////////////ANONYMOUS FUNCTION/////////////////////////////////////////as
//5
test5 = function()
{
return("5")
}
console.log(test5());
//6
test6 = function ()
{
console.log("6")
}
test6();
//7
test7 = function (x, y = 3)
{
console.log(x + y);
}
test7(4);
//8
test8 = function (x, y = 4)
{
console.log(x + y);
}
test8(4);
///////////////////////////////////ARROW
FUNCTION///////////////////////////////////////////////////////////////////////
//9
test9=()=>{
return "9";
}
console.log(test9());
//10
test10=()=>{
console.log( "10");
}
test10();
//11
test11=(x, y = 10)=>
{
console.log(x + y);
}
test11(1);
//12
test12=(x, y = 10)=>
{
return "x + y";
}
test11(2);
</script>
</body>
</head>
</html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<title>promise_YASH</title>
</head>
<body>
<script>
var p = 92;
var t = new Promise((resolve, reject) => {
console.log("Loading ..........");
setTimeout(() => {
if (p > 60) {
resolve("It is resolved");
}
else {
reject("It is reject");
}
}, 2000);
}).then((result) => {
console.log(result);
}).catch((err) => {
console.log(err);
});
</script>
</body>
</html>
server.listen(3000, () => {
console.log('Server running at http://localhost:3000/');
});
check = () => {
/// GreetingClass.js///
render() {
return (
<>
Username: <input type="text" name="Username" />
< br />
Password:<input type="text" name="Password" />
</>
)
}
}
////App.js////
function App() {
return (
<div>
<GreetingClass />
<GreetingFunction />
</div>
);
}