Saturday, 31 July 2021

JavaScript Playlist tutorial #14 | Full information on Arrow function and class @echocoding | soham


Arrow function and class Introduction of arrow function 00:20 class in JavaScript 5:45 ------------Subscribe channel please ----------- Arrow function is like a normal function but difference is we use here () in place of function . It is introduce in ES6. Arrow function is very easy to code and make our code reusable and clean We can also pass variable in arrow function Class is used in oops concept here I am going to give short introduction of class .
source code :-

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Arrow function</title>
</head>
<body>
   <script>
    //    function hello(){
    //     return document.write("this is coding");
    //    }
       hello = function(){
         return  document.write("this is coding");
       }
       hello();

    //    hi = () =>{
    //     document.write("<br>this is coding throw arrow function");
    //    }
    //    hi();
        
    hi = (x) => document.write("<br>this is coding throw arrow function"+x);
      
       hi(3333);

       class Car {
           constructor(name,year){
                this.name = name;
                this.year = year;
           }
       }

       var car1 = new Car("Ford",2000);      
       document.write(car1['name']);
       document.write(car1['year']);

       var car2 = new Car("Rrrr",1200);
       document.write(car2['name']);
       document.write(car2['year']); 



   </script> 
</body>
</html>




 

JavaScript tutorial #13 | loops in javascript @echocodin | soham kavde

 



source code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
      
     for(let i =1; i<=10; i++){
         document.write(i+'<br>');
     }
    document.write("arrays")
     var number  = [1,2,3,4,5];
     for(var u = 0; u<=number.length-1; u++){
         document.write(number[u]+'<br>');
     }
     console.log("while")
     var w = 0;
     while(w<=5){
        console.log(w);
         w++;
     }
     console.log("do while")
     var e = 0;
     do {
        console.log(e);
         e++;
     } while (e<=5);
        
    </script>
</body>
</html>

JavaScript tutorial #12 | Conditional statements (if , else else if , switch ) @echocoding | soham


source code

var x = 1;
var y = 1;

if(x==y){
    //code
    document.write("X is equal to Y");
}

var x1 = 11;
var y2 = 12;

if(x1==y2){
    //code
    document.write("X1 is equal to Y2");
}else{
    document.write("<br>X1 is not equal to Y2");
}


var x11 = 11;
var y22 = 12;
var z33 = 11;
var r33 = 12;

if(x11==y22){
    //code
    document.write("X11 is equal to Y22");
}else if(x11 == r33){
    document.write("X11 is equal to R33");
}else if(x11 == z33){
    document.write("<br>X11 is equal to Z33");
}else{
    document.write("No match found");
}

var x11 = 11;
var y22 = 12;
var z33 = 111;
var r33 = 12;

if(x11==y22){
    //code
    document.write("X11 is equal to Y22");
}else if(x11 == r33){
    document.write("X11 is equal to R33");
}else if(x11 == z33){
    document.write("<br>X11 is equal to Z33");
}else{
    document.write("<br>No match found");
}



var x121 = 11;
var y222 = 12;
var z323 = 11;
var r323 = 12;
switch (x121){
    case y222:
        document.write("X11 is equal to Y22");
        break;
    default:
            document.write("<br>default No match found");   
            break;
     case z323 :   document.write("<br>X11 is equal to Z33");
        break;
    case r323:
        document.write("X11 is equal to R33");
        break;
   

}


 

Monday, 26 July 2021

JavaScript tutorial #11 | Array in one video @echocoding | soham kavde

 


JavaScript tutorial #11 | Array in one video @echocoding | soham kavde

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Array</title>
</head>
<body>


    <script>
        // var car = [1111,true,"3333","4444"]; //first way to create array
        var car = new Array(1111,true,"3333","4444","5555"); //second way to create array
        car[0] = 'one_one';
        var x = car[0];
        console.log(car);//accessing complete array
        console.log( x );
        console.log(car[1]);
        console.log(car[2]);
        console.log(car[3]);
        console.log(car[4]);
        console.log(car.length);
        console.log(car.toString());
        console.log(car.join(" | "));
        console.log(car.pop());
        console.log(car); //(4) ["one_one", true, "3333", "4444"]

        console.log(car.push("5555"));
        console.log(car); // (5) ["one_one", true, "3333", "4444", "5555"]

        var number = [8,1,2,3,4];
        console.log(number.sort());
        console.log(number.reverse());

        var number = ["cat","dog","apple","ball"];
        console.log(number.sort());
        console.log(number.reverse());
        console.log(typeof(number)); // typeof object
        console.log(Array.isArray(number)); //return true
        console.log(number instanceof Array); //return true
     

    </script>
  
</body>
</html>


Saturday, 24 July 2021

JavaScript tutorial #10 | numbers and number method detailed video @echocoding | soham kavde

 


timestamps: number with or without decimal value 1:16 scientific notation in JavaScript 3:12 limitation of number 4:50 add number and string 6:00 number methods 13:40


number.js

var x = 5;
var y = 5.5;
var z = 43e1;
// console.log(z);
var r = 43e-3;
// console.log(r);
var ff = 999999999999999;
// console.log(ff);
var f_f = 9999999999999999;
// console.log(f_f);

// adding number and strings

var num = 1;
var str = '2';
// console.log(num+str);

var one = 1;
var two = 2;
var ss = one+two;
// console.log(ss);

let onre = "1";
let twor = "2";
let sss = onre  + twor;
console.log(sss);

let yy = "10";
let uu = "8";
let tt = yy-uu;
console.log(tt);

let y_y = "10";
let u_u = "8";
let t_t = y_y*u_u;
console.log(t_t);


var hello = 10;
var strin = "Hello";
console.log(hello*strin);// Not a number

// Number methods
var ffff = hello.toString();
// console.log(typeof(ffff));
var ffff = strin.toString();
console.log(ffff);

// toFixed()
var numbers= 9.653;
console.log(numbers.toFixed(1));


JavaScript tutorial #9 | JavaScript Search text string method @echocoding | soham kawde

 


free source code :- content of table is indexOf( ) string method lastIndexOf( ) string method search( ) string method Difference between indexOf and search includes( )string method startWith( ) endWith( ) indexOf( ) string method : - This javaScript string method get the position of given word's first occurrence. Example of indexOf( ) :- If given text is "My name is soham"; and You are searching for "name" in the indexOf method. You will get 3 in result. Because in "name" , n is first character so the position of n is result position number of indexOf( ). method. Note: IndexOf( ) search and count from left to right and return position of first occurrence only. lastIndexOf( ) string method : - This JavaScript string method return the position of last occurrence but it count same as indexOf( ) method ( left to right ) and search from Right to left . Example :- Given text is "This glass of water has no water." search for "water" in given text you will get 25 position number for water. from Right side to left side lastIndexOf( ) start searching and from left side to right side it start counting. Hence result is 25 What happens if searching text like name and water is not exist in given text ? IndexOf and lastIndexOf method return -1 for no match. Difference between indexOf( ) and search( ) IndexOf() method get no regular expression. search() method has no second parameter to pass. includes() : - return true for match occurrence and false for no match. startWith() :- Return true if the text is start with searching text with is passed in startWith method else return false. endWith( ) : - return true if the text is end with searching text with is passed in endWith() method else return false.



<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
        var text = "this is programming coding programming";
        var x = text.indexOf('programming',10);
        // document.write(x);
        var y = text.lastIndexOf('programming',20);
        // document.write(y);

        var yl = text.lastIndexOf('otherword');
        // document.write(yl);
        var s = text.search('programming');
        // document.write(s);
        var inc = text.includes('coding');
        // document.write(inc);
        var start = text.startsWith('is',5);
        // document.write(start);
        var end = text.endsWith('programming',19);
        document.write(end);
    </script>
</body>
</html>

Thursday, 15 July 2021

JavaScript tutorial #8 | string properties , methods in javaScript @echocoding |soham kawde

  string properties , methods in javaScript


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>string</title>
</head>
<body>

    <script>
        var text = 'Hello programmers';
        var text1 = "Hello programmers";
        // console.log(text);
        // console.log(text1);
        var single = 'it\'s my pleasure';
        var singlew = "it\"s my pleasure";
        console.log(single);
        console.log(singlew);

        // single quotes in double quote and vise wersa
        var single = "It's my pleasure";
        var single = 'It"s my pleasure';
        // var back = "2\3" // throw an error
        var back = "2\\3";
        console.log(back);

        var len = "this is paragraph text paragraph for paragraph length checking";
        console.log(len.length);
        var x = len.slice(0,4); // starting point , end point
        console.log(x);
        x = len.slice(5);
        console.log(x);
        x = len.slice(-12,-2);
        console.log(x);
        
       var y = len.substring(0,4); // substing not take negative values (-12,-2); starting point , end point
        console.log(y);

       var c = len.substr(10,10); // starting point , length
        console.log(c);

       var f = len.replace(/paragraph/g,'div');
        console.log(f);
        f = len.replace(/Paragraph/i,'div');
        console.log(f);

        // upperCase 
         var upp = len.toUpperCase();
        //  document.write(upp);
         var low = upp.toLowerCase();
        //  document.write(low);

         var con = upp.concat(' ' + low);
        //  document.write(con);

         var trimmm = "       heloo    sdf    fdf         ";
         document.write(trimmm.trim());


    </script>
</body>
</html>



By laptop