Code for Binary Search Algorithm (JavaScript)

What does Binary Search Algorithm do? Given a sorted array of n elements, write a function to search for the index of a given element (target). Process of working of Binary Search Algorithm? Search for the array by dividing the array in half repeatedly. Initially consider the actual array and pick the element at the … Read more

JavaScript Arrays

declaring arrays in JavaScript, creating array in JavaScript, javascript constructor Array(), ways to read/write array elements in JavaScript, javascript .length property, adding/deleting elements from javascript array

JavaScript Arrays are kind of unique data structure, as these are just JavaScript Objects but property names being index(integer). Index for JavaScript arrays uses 32-bit number system meaning JavaScript’s arrays index can vary from 0 to 232-2 totalling 4,294,967,295 elements in an array, that’s why JavaScript array can hold a lot of data. Below are … Read more

toString() method in JavaScript

array toString() method, number toString method, string toString() method, JavaScript toString() method

JavaScript’s toString() method is quite uniques in the sense that it can be applied to JavaScript Number, String, Arrays. When invoked on any of these identifier JavaScript interpreter will take value inside identifier and spit it out. If in case your not aware of what are JavaScript Number, String, Arrays? Then please go to below … Read more

JavaScript Array Methods

javascript array methods push(), pop(), shift(), unshift(), values(), toString(), splice(), some(), reverse(), map(), join(), indexOf(), includes()

Arrays in JavaScript are quite useful as these can hold a lot of data(4,294,967,295 elements in a single array), that’s why JavaScript have a lot of methods to deal with arrays which further increases their usefulness in programming. Below is a table summarsing all of methods which can be invoked on array objects in JavaScript. … Read more

Object Methods in JavaScript

Objects are amazing, as these could encapsulate data inside them in form of property-value pairs. If in case nothing can be done with these objects then these would be useless in code. But there does exist many methods/functions which can be invoked on objects in JavaScripts. For example – hasOwnProperty() method. Moreover if your not … Read more

Deleting/Testing JavaScript Object’s Properties

Deleting/Adding Properties in JavaScript Objects, Ways to test whether an Object has a property or not, hasOwnProperty() method, in operator for checking properties, comparing JavaScript Object's property with undefined

JavaScript Objects are a sort of a bucket containing properties – values pairs, but these are meaningless unless something can be done using data contained inside objects. That’s JavaScript have some operators which can be performed on object’s properties. Like delete for removing a property of an object. Deleting/Adding Properties in JavaScript Objects Add Property … Read more

Accesing JavaScript Object’s Properties

Ways to access Object Properties in JavaScript, Dot Property Accessor, Square brackets property accessor, Object Destructing Accessor

Any object in JavaScript is just a collection of properties-values pairs, like { x: 0, y: 1 }; is a JavaScript Object with two properties x, y. As throughout the code we need to change either object’s properties or values. That’s why JavaScript have a number of functions specifically for dealing with this. What are … Read more

Objects in JavaScript

Objects in JavaScript, How to create objects in JavaScript, new object javascript, object() javascript method, prototype in JavaScitipt

Being a programmer for years at-least now, I have coded in enough programming languages that I could generalise and perhaps conclude fundamentals of a programming languages – Entities(objects, variables), Functions, Control flow(loops). These three are sort of fundamental components of any programming langauge. In JavaScript as well, Objects are quite fundamental and are made of … Read more

Jumps in JavaScript

The fundamentals of a programming language involves declaring identities(variables, functions), statement blocks(treating a lot of code as a single block), loops repetitively executing a piece of code and one important aspect of just jumping around in the code. The idea of jumping around in code becomes prevalent if you have thousands of line of code … Read more