Welcome to the Webmaster Forum.
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Aug 2015
    Location
    chandigarh
    Posts
    40

    What is ‘this’ keyword in JavaScript?

    Hi,
    I would like to know,
    What is ‘this’ keyword in JavaScript?

  2. #2
    Senior Member
    Join Date
    Aug 2014
    Location
    India
    Posts
    183

    Re: What is ‘this’ keyword in JavaScript?

    In JavaScript, the thing called this, is the object that "owns" the JavaScript code. The value of this, when used in a function, is the object that "owns" the function. The value of this, when used in an object, is the object itself.

  3. #3
    Junior Member
    Join Date
    Feb 2018
    Location
    Hyderabad
    Posts
    23

    Re: What is ‘this’ keyword in JavaScript?

    The this keyword refers to the current instance of the class.

  4. #4
    Member
    Join Date
    Dec 2017
    Location
    Santa Clara, California, USA
    Posts
    81

    Re: What is ‘this’ keyword in JavaScript?

    The (this) keyword is one of the most widely used and yet confusing keyword in JavaScript. (this) keyword points to a particular object. Now, which is that object is depends on how a function which includes 'this' keyword is being called.

  5. #5
    Senior Member
    Join Date
    Sep 2014
    Location
    India , New Delhi Uttam nagar
    Posts
    359

    Re: What is ‘this’ keyword in JavaScript?

    this is the current execution context of a function.

  6. #6
    Junior Member
    Join Date
    Oct 2017
    Location
    Hoshiarpur
    Posts
    14

    Re: What is ‘this’ keyword in JavaScript?

    JavaScript is the programming or scripting language and it creates dynamically control multimedia, animated images. ‘This’ keyword is powerful global object & it is one of the most misunderstood parts of JavaScript and this keyword is using for execution the context. For example:-
    function f1() {
    return this;
    }
    // In a browser:
    f1() === window; // true
    // In Node:
    f1() === global; //

  7. #7
    Junior Member
    Join Date
    Mar 2018
    Posts
    27

    Re: What is ‘this’ keyword in JavaScript?

    This keyword in an object constructor does not have a value. It is only a substitute for the new object.The value of this will become the new object when the constructor is used to create an object.

  8. #8
    Junior Member
    Join Date
    Aug 2018
    Posts
    21

    Re: What is ‘this’ keyword in JavaScript?

    In simple words-

    In Javascript, property of an object can be a method or a simple value. When an Object's method is invoked then “this” refers to the object which contains the method being invoked.




    -------------------------------------------------------------------------------
    https://www.netguru.co/react-js

  9. #9
    Junior Member
    Join Date
    Aug 2018
    Posts
    16

    Re: What is ‘this’ keyword in JavaScript?

    A function's this keyword behaves a little differently in JavaScript compared to other languages. It also has some differences between strict mode and non-strict mode.

    In most cases, the value of this is determined by how a function is called. It can't be set by assignment during execution, and it may be different each time the function is called.

 

 

Similar Threads

  1. Javascript
    By Michael in forum Web & Graphics Design
    Replies: 18
    Last Post: 11-23-2016, 12:27 AM
  2. Why Choose JavaScript?
    By chinmay.sahoo in forum Coding & Programming
    Replies: 4
    Last Post: 02-16-2016, 09:01 AM
  3. Javascript
    By Realitytvaddict in forum Coding & Programming
    Replies: 21
    Last Post: 01-02-2016, 08:37 PM
  4. JavaScript affect in SEO
    By chinmay.sahoo in forum Search Engine Optimization (SEO)
    Replies: 2
    Last Post: 12-07-2015, 08:39 PM
  5. javascript and php with curl
    By siec in forum PHP
    Replies: 0
    Last Post: 02-11-2014, 03:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Back to top

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186