Teaching Newbies since 2014

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

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 20, 2020 by: Kauress

Classes in JavaScript – a newbie friendly introduction

Classes In object-oriented programming, class types are templates for creating objects. As we justlearned that in prototypal inheritance, objects inherit properties and methods from aprototype. Classes build upon prototypal inheritance. Classes were introduced in ES6 tomimic the class data type found in Java and other object-oriented programming languages. Till now developers used constructor functions to mimic object-oriented design patterns.JavaScript does not have the class type,

[ 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 © 2022 ·Kauress