Javascript Chp 1 , Introduction - Basics of Js
<!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 class="con">
<h1>Zindagi ek fareb aur jhoot ka ek kissa hai jo lakeeron mein bandhkar theher nahi sakta</h1>
</div>
<script>
// //javascript console API (Application programming interface)
// console.log("Aye haye Oye hoye");
// console.error("This is an error");
// console.warn("This is a warning");
// // Are used inside console
// console.clear()
// console.assert(5==10)
// // Ways to print in javascript
// alert("Don't worry you're just an asshole");
// document.write("Aye haye oye hoye")
// Variables in javascript
// var a = 45;
// var b = 56;
// console.log(a+b);
// Data types in Javascript
// String
// var str = "This is a string";
// Number
// var num2 = 455;
// Objects
// var marks = {
// shani: 500,
// abhishek: 50,
// Yash: 12,
// pasha: 30.78,
// }
// console.log(marks);
// booleans
// var a = true;
// var b = false;
// console.log(a,b);
// var und = undefined;
// console.log(undefined)
// operators in js
// // 1. Arithmetic operators
// var x = 60;
// var y = 12;
// var sum =x+y ;
// var difference =x-y ;
// var product =x*y ;
// var quotient =x/y ;
// var remainder =x%y ;
// var increment =x++;
// // var decrement =y--;
// console.log("This is the sum",sum);
// console.log("This is know as difference",difference);
// console.log("This is product",product);
// console.log("This is the quotient",quotient);
// console.log("This is the remainder",remainder);
// console.log("This is increment",x);
// // console.log("This is decrement",y);
// console.log("The sum is_",x+y);
// var data = {
// yash:500,priti:"That's how you can print it",
// }
// console.log(data);
// console.log(data.yash);
// console.log(data.priti);
// // displays an error when a particular condition fails !!
// console.assert(x+y==100,"That's how it shows an error");
// These are comparison operators :-
// let a=50;
// let b=60;
// console.log("a==b is __ ",a==b)
// and then we have logical operators :-
// let g=90;
// let y="90";
// console.log("a==y && a===y is ______",g==y && g===y);
// console.log("a==y && a===y is ______",g==y || g===y);
</script>
</body>
</html>
Comments
Post a Comment