Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript this Inside Object Method

const person = {
    name : 'Jack',
    age: 25,

    // this inside method
    // this refers to the object itself
    greet() {
        console.log(this);
        console.log(this.name);
    }
}

person.greet();
Comment

PREVIOUS NEXT
Code Example
Javascript :: react native flatlist flex direction 
Javascript :: image react native base64 
Javascript :: javascript map replace key value 
Javascript :: write head node js 
Javascript :: simple todo list javascript 
Javascript :: javascript fade color 
Javascript :: empty javascript 
Javascript :: javascript pad string left 
Javascript :: vue multiple slot 
Javascript :: how to async javascript stack overflow 
Javascript :: Nuxt.js + Electron 
Javascript :: send a message in every guild discord.js 
Javascript :: knex pagination plugin 
Javascript :: Map put() method 
Javascript :: clean-webpack-plugin clearing dist folder 
Javascript :: console.log() Syntax 
Javascript :: how to compile javascript 
Javascript :: full screen mode 
Javascript :: utc clock 
Javascript :: javascript array slice() example 
Javascript :: js standard global 
Javascript :: react places autocomplete 
Javascript :: javascript map method 
Javascript :: send json in javascript 
Javascript :: mongoose virtual populate 
Javascript :: jsonl parser javascript 
Javascript :: How To Use Multiple Styles in REACT 
Javascript :: document.createelement with id 
Javascript :: react native stepper 
Javascript :: for pug 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =