Monday, October 1, 2018

JS9_JavaScript Few Built In functions

JS9_JavaScript Few Built In functions



setTimeout(function() { console.log("Hi.."); },2000);
clearTimeout(myObj);

//######################################################################################################

setInterval(function() { console.log("Hi.."); }, 2000);
clearInterval(myObj);

//######################################################################################################

let myVariable = function() { console.log("Hi2.."); };              //note: even if this line is <body><script> unless it is called it will not execute.
myVariable();

//######################################################################################################
const employee = {
            firstName: '',
            setName: function(name){
                let splitName = (n) => {
                    let nameArray = n.split(' ');
                    this.firstName = nameArray[0];
                }
                splitName(name);
            }
        }

employee.setName('pavan kumar');
console.log(employee.firstName);

//######################################################################################################

//Array logics

const courses = [
    {id: 1, name: 'course1'},
    {id: 2, name: 'course2'},
    {id: 3, name: 'course3'},
];

const courseExist = courses.find(c => c.id === 5);

const myNewCourse = {id: 4, name: 'course4'}
courses.push(myNewCourse);

courses.splice(2,1);

JS8_JavaScript TrickyQuestions

JS8_JavaScript TrickyQuestions



JS7_Fat ArrowFnc

JS7_Fat ArrowFnc



JS6_Private Variable And Method

JS6_Private Variable And Method



JS5_Prototype - dynamicProperty And OverridingMethod

JS5_Prototype - dynamicProperty And OverridingMethod



JS4_Overloading Not Possible

JS4_Overloading Not Possible


JS3_Global and Custom Objects

JS3_Global and Custom Objects


JS9_JavaScript Few Built In functions

JS9_JavaScript Few Built In functions setTimeout(function() { console.log("Hi.."); },2000); clearTimeout(myObj); //######...