Teaching Newbies since 2014

kauress

  • Home
  • Javascript ❤
    • JavaScript
    • Node.js
  • WebDev Tuts
  • screencasts
  • Resources
  • VR & AR
  • Contact
  • Github
  • Twitter
  • YouTube
  • RSS
  • C++
You are here: Home / Archives for setter

August 21, 2020 by: Kauress

Getters & Setters in JavaScript – part 2

carrying on from part 1 .. Getters in JavaScript Getters are functions that retrieve a value from static properties from an external source. You can only access properties and cannot access methods as they are functions of an object or class and are not static.There are three ways you can use getters and setters:1. Default method syntax2. get  keyword3. Object.defineProperty() method We will now discuss

[ Read More ]

August 19, 2020 by: Kauress

Setters and Getters in JavaScript – part 1

Accessors: Getters and Setters This is part 1  of a brief introduction to getters and setters in JavaScript. Getters and Setters are ES5 features. Objects have two types of properties: Static data property Accessor property So far we have come across static data properties in the objects that we have been making. For example: let blackLivesMatter = { status: true, usecase: ‘daily’ } In this

[ Read More ]

Copyright © 2021 ·Kauress