Posts

Showing posts from May, 2023

Javascript | Control Statement & It's Types By. Shivansh Sir

  JAVASCRIPT   JAVASCRIPT |  CONTROL STATEMENT |   IF STATEMENT If Statement में जब condition 'true' होती है तब if statement execute होता है |अगर condition false होती है तो statement execute नहीं होता | Syntax if(condition){ //if statement(s); } Source Code : <script type="text/javascript"> var a = 10, b = 15; if(a < b){ document.write("a is less than b"); } </script> Output a is less than b. JAVASCRIPT |  CONTROL STATEMENT |   IF ELSE STATEMENT if_else Statement में जब condition 'true' होती है तब if का statement execute होता है अगर condition 'false' होती है तो else का statement execute होता है | Syntax  if(condition){ //if statement(s); }else{ //else statement(s); } Source Code <script type="text/javascript"> var a = 10, b = 15; if(a > b){ document.write("a is greater than b"); } else{ document.write("a is not greater than b"); } </script> Output a is not greater than b....

Javascript | Javascript Operators & It's Types By. Shivansh Sir

JAVASCRIPT   JAVASCRIPT | OPERATOR | ARITHMETIC OPERATOR Addition(+)  Operands को add करने के लिए Addition Arithmetic Operator का इस्तेमाल किया जाता है | Source Code <script type="text/javascript"> var a = 6, b = 3, c; c = a + b; document.write("Value of c is " + c); </script> Output Value of c is 9 Subtraction(-) Operands को subtract करने के लिए Subtraction Arithmetic Operator का इस्तेमाल किया जाता है | Source Code <script type="text/javascript"> var a = 6, b = 3, c; c = a - b; document.write("Value of c is " + c); </script> Output Value of c is 3 Multiplication(*) Operands को multiply करने के लिए Multiplication Arithmetic Operator का इस्तेमाल किया जाता है | Source Code <script type="text/javascript"> var a = 6, b = 3, c; c = a * b; document.write("Value of c is " + c); </script> Output Value of c is 18 Division(/) Operands को divide करने के लिए Division Arithmetic Operator का इस्तेमाल किया...

Javascript | Data Type | Primitive Data Type By. Shivansh Sir

JAVASCRIPT JAVASCRIPT |  STRING String ये Characters का sequence होता है |  String को single या double quotes के अन्दर लिखा जाता है | var str1 = 'SUNRISE'; var str2 = "COMPUTER"; JAVASCRIPT | STRING |  EMPTY STRING var str3 = ""; Strings को दो प्रकार से create किये जाते है | String Type String Object Type var str4 = "WELCOME TO SUNRISE COMPUTER"; //String Type var str5 = new String("WELCOME TO SUNRISE COMPUTER"); //String Object Type Check Strings Equal or Not using '==' Operator  '==' Operator से दोनों Strings equal है | Source Code true Output true Check Strings Equal or Not using '==' Operator '===' Operator से दोनों Strings equal नहीं है, क्योंकि उनके data types अलग-अलग है | Source Code false Output false Example तो double quoted String में double quoted String दिया हुआ है | इससे String access नहीं होता | var str = "WELCOME TO "SUNRISE" COMPUTER"; document.write(str); Notes :- यद...