The this keyword in JavaScript references the object that is executing the current function. If that function is a method in an object, the this keyword references the object itself. Otherwise if that function is a regular function(i.e it is not part of an object) the this keyword references the global object which is window object in browsers and global in Node. Here are some examples:

In this Article, i will be explaining some interesting concepts in JavaScript. The differences between the Local and Global Scope and also the Let vs Var Keyword in JavaScript.

Local vs Global Scope

The Scope of a variable or constant determines where a variable or constant is accessible during runtime. There’s a general discussion about the differences between Local and Global scopes In JavaScript. I’ll highlight the major differences between the two concepts in this article.

Local Scope

Variables or Constants declared within a code block are said to be in a local scope. When we declare a variable or constants with the let or const

Arrays in JavaScript are reference types, its possible to use different in-built methods to perform certain tasks with an array. I’ll be explaining some of this operations in this article.

Testing The Elements Of an Array

There are two(2) different methods to checks if all elements in an array pass a certain test (provided as a function), which are the every method and some Method.

The every Method

The every() method checks whether all the elements of the array satisfies the given condition or not that is provided by a method passed to it as the argument. If it finds an array element where the function returns a false

Arrays in JavaScript are Reference Types. It’s possible to modify the elements in a given array. Using the Dot Notation we can access all the properties and methods defined in an Array.

Adding Elements In An Array

It’s possible to modify an Array by Adding an element to it. We can add an element at the Beginning of an Array, In the Middle, and also at the End of an Array. We can do this using the following methods:

The push Method

The push Method allows us to add one or more element to the end of an array. Here’s an Example:

It’s my second day into the #100DaysOfCode challenge. You can check out my previous article here .

Today kicked off with a topic i found relatable and very applicable. I Played around with some exercises and i’ll be sharing all I've learnt on this topic.

Enumerating Properties in an Object

Objects are Reference types in JavaScript, in essence all Reference types are Objects. We can enumerate the properties of any given object with some approach or methods.

Using The For-In loop

With the For-In Loop we can enumerate all the properties and methods in an object. Let’s see a clear example:

I started the #100DaysOfCode challenge today, you can join me on this challenge here

I’ll be kicking this challenge off with a very interesting yet confusing topic on JavaScript, The Factory Functions And The Constructor Functions.

Factory Functions

Factory Functions are functions which are neither classes or constructors. If a function returns a new object without the new keyword,they are said to be a Factory Function. The Naming Convention used here is the Camel Notation. Let’s see an example of a Factory function

Jhimmy Official

Tech Enthusiast,Programming or Nothing!!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store