Your Code (Basics)
Rohit143
html
3 years ago
3.7 kB
6
Indexable
<!DOCTYPE html> <html lang="en"> <head> <title>rohit</title> </head> <body> <h1>hello javascript</h1> <p></p> </body> <script> // variable declaration : // var naav = number // ==:check // if(condion){ // code... //+-> concatination(join) operator // 4,5 // Comparison Operator // 1)== // 2)greater>smaller // 3)4>=3->greater than or equal to <= // var n1 = prompt("Enter first number") // var n2 = prompt("Enter second number") // var n3 = prompt("Enter third number") // if (n1 != "" && n2 != "" && n3 != "") { // if (n1 < n3 && n1 < n2) { document.write(n1 + " is smaller than " + n2 + " & " + n3); } // else if (n2 < n1 && n2 < n3) { // document.write(n2 + " is smaller than " + n1 + " & " + n3); // } // else if (n3 < n1 && n3 < n2) { // document.write(n3 + " is smaller than " + n1 + " & " + n2) // } // } // else { // document.write("Please refresh the page and enter number again") // } // var n = prompt("1 te 4 chya madhil no. taak") // if (n != "" && "5") { // if (n == "1") {document.write("one") // } // else if (n == "2") {document.write("two") // } // else if (n == "3") {document.write("three") // } // else if (n == "4") {document.write("four") // } // else {document.write("abe 1 te 4 chya madhil taak mhatl n Rohit")} } // document.write("my name is Gaurav"+"my name is Gaurav "+"my name is Gaurav "+"my name is Gaurav "+"my name is Gaurav "+"my name is Gaurav "+"my name is Gaurav "+"my name is Gaurav "+"my name is Gaurav "+"my name is Gaurav ") /* intialization->variable starting value while(condition){ code... increament/decrement } */ // var str = "my name is Gaurav <br>" // var startingNumber =1 //initailization // while (startingNumber<11) { // document.write(startingNumber) // startingNumber++ //increament // } //var str = "my name is Rohit <br>" // var begin =10 // while (begin>0) { // document.write(begin) // begin-- // } // do { // code... // } while (condition); // for(var i=1;i<11;i++){ // document.write(i) // } // for(var i=10;i>0;i--){ // document.write(i) // } // function product(num1,num2) { // document.write(num1*num2) // } // //2,3 // function sum(num1,num2) { // document.write(num1+num2+ "<br>") // } // var num1=parseInt(prompt("enter first number")), num2=parseInt(prompt("enter second number")) // // num=2 // // num=3 // // 2,3 // sum(num1,num2) // product(num1,num2) // var arr=[1,2,3,4,5,6,7,8,9] // var array=["one ","two ","three "] // // document.write(array[0]) // // document.write(array[1]) // // document.write(array[2]) // document.write(arr.length) // for (let index = 0; index < array.length; index++) { // const element = array[index]; // } </script> </html> <!-- this is comment -->
Editor is loading...