JAVASCRIPT - to interacte or dynamic the website.
HTML - to CREATE ther content
CSS - to STYLE the content
Benefit - Scripting language using JS can change the web pages
1) Alert(" ")
2) Document.write()
3) innerhtml
///Sample Program///
<head>
<body>
<script type="text/javascript">
alert("HELLO")
document.write("HELLO")
</script>
<h1>This is ME</h1>
<h1 id="special">This is ME</h1>
</body>
***********************************************************************
Downlaod VS code application
console.log("please subscribe");
console.log("DATA");
Downlaod --> coderunner, live server & JS ES6 - extensions
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
console.log - will write in VScode
document.write - will impact in the website
COMMENT - way to deliver the message
1) single line (//) - used befora & after the statement
2) Multi line (/__code__/) - used to add single as well as multi line comments.
a.Elobrate the Code
b.End User can understand easily
c.Can avoid the un-necessary code lines
1.js
ex - //this is first one
//Variable
a=10;
b=5;
console.log(a);
///***basic.html
<html>
<head>
<body>
<script>
document.write("Hello");
</script>
</body>
</head>
<html>
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
///***DataTypes
1) var
A. Primitive --> string, Number, Boolean
B. Non-primitive(Reference) --> Object, Array, RegExp
var a= 10;
var a= 67.77;
var a="hello";
var c='Hell';
var d = true/false;
ctrl+alt+N - can execute
_______________________________________________________
var a=10;
var b="Hell";
console.log(a);
console.log(b);
#######################################################################
///***Variables & Identifiers
var, const, let
Declare - var varible_name; | Let variable_name | const varible_name;
Initialize
varible_name=value;| Let varible_name=value; | const varible_name=value;
Conditional operator --> condition?Expression1 : Expression2;
Ex:--> var a=10;
var b=6;
a<b?console.log("a is big"):console.log("b is big"); // It will print "10 is big"
Type conversion --> converting one data type to another
Ex -- String to Number
Implicit & Explicit(built-in)
implicit to String -->'3'+2 = 32 // Concatination(adding both variables)
implicit to Number --> '4'-'2'= 2
implicit boolean to number --> '4'-true = 3 // Boolean values True =1, False =0
var result='3'+45 = 345 // Concatination(adding both variables)
console.log(result);
var result='300'-40 = 260
console.log(result);
var result='30'+true = 31 // Boolean values True =1, False =0
console.log(result);
///***STRING
length
charAt()
indexOf()
toUpperCase()
toLowerCase()
toString()
Escape Charecter -
console.log("it\'me"); --> it' me
\t - space
\n - Next line