Introduction

Welcome to this course!

Before we delve deeper into JavaScript essentials for interview prep, let's start with some foundational JavaScript features — specifically, arrays and strings. These features allow JavaScript to group multiple elements, such as numbers or characters, under a single entity.

Revising Arrays and Strings

As our starting point, it's crucial to understand how arrays and strings function in JavaScript. An array is a built-in object that provides a way to store multiple values in a single variable and is mutable (we can change it after creation), while strings are immutable (unalterable post-creation). Let's see examples:

Diving Into Lists

Arrays in JavaScript allow us to organize data so that each item holds a definite position or an index. The index allows us to access or modify each item individually. For accessing elements, JavaScript arrays use zero-based indexing. This means the first element in the array is accessed with index , the second element with index , and so on. To get the last element of the array, we subtract one from the array's length ( in the example below).

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal