Object-Oriented JavaScript — Polymorphism and Primitive Values

Object-Oriented JavaScript — Polymorphism and Primitive Values

The basic building blocks of object-oriented JavaScript are primitive data types. In JavaScript, primitive data types are strings, number, booleans, null , undefined and bigint. They're all recorded as values and have no methods of their own unless they're wrapped in wrapper objects.

JavaScript is partly an object-oriented language.

To learn JavaScript, we got to learn the object-oriented parts of JavaScript.

In this article, we’ll go through the object-oriented parts of JavaScript.

We also look at the basic building block of objects, which are primitive values.

Polymorphism

Polymorphism means that if we substitute one subclass with another, that the program should still work the same way if the code uses the parent’s properties or methods.

If they both inherit from the same parent class, then they should have the same methods, so they should work the same way.

If the Person class has the talk method and we created 2 subclasses that inherit from them.

Then we can use any of those subclass’ talk method.

Primitive Data Types

The basic building blocks of object-oriented JavaScript are primitive data types.

In JavaScript, primitive data types are strings, number, booleans, null , undefined and bigint.

They’re all recorded as values and have no methods of their own unless they’re wrapped in wrapper objects.

Variables

Variables are used to store data.

They’re placeholders for concrete values.

It’s more convenient to use variables than the values to wor with the actual data.

This is because they can be used multiple times.

Values can only be used once.

Using variables requires 2 steps.

We’ve to declare it, and then we’ve to assign it a value.

To declare a variable, we can write:

let a;

A variable can be a combination of letters, numbers, and underscore characters.

But we can’t start with a number.

Then to initialize it, we assign a value to it.

For instance, we can write:

let a = 1;

We can do both in one step.

Variables declared with const requires a value to be assigned when it’s declared.

So we write something like:

const a = 1;

We can declare multiple variables in one statement, like:

let a = 1,
  b = 2,
  c = 3;

programming technology javascript software-development web-development

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Offshore Software Development - Best Practices

To make the most out of the benefits of offshore software development, you should understand the crucial factors that affect offshore development.

Software Developer vs Web Developer | Difference Web Developer & Software Developer

Software Developer vs Web Developer | Difference Web Developer & Software Developer | Software development and web development are normally used interchangeably. Although both include development, a software developer has different responsibilities from that of a web developer.

5 Core Criteria for Selecting Software Development Company - TopDevelopers.co

Check out these five criteria for the selection of your software vendor, and you will never regret having the wrong quality product made for you.

Offshore Software and Web Application Development Company- MobiWeb Technologies

Mobiweb Technologies is a prestigious IT company headquartered in Indore providing promising and cost effective software and web development services across the globe.

Offshore Software and Web Application Development Company- MobiWeb Technologies

Mobiweb Technologies is a prestigious IT company headquartered in Indore providing promising and cost effective software and web development services across the globe.