Dive into the world of JavaScript with our engaging and informative tutorials. Enhance your coding abilities through hands-on practice in the LabEx online playground.

JavaScript HSL to RGB Conversion

In this lab, we will delve into the world of JavaScript programming and learn about HSL to RGB conversion. You will be introduced to the HSL to RGB conversion formula, and how to use it to convert HSL color tuples to RGB format. By the end of this lab, you will have gained a deeper understanding of how to work with color in JavaScript and how to manipulate HSL values to create beautiful color schemes.

JavaScript

Online JavaScript Playground

Discover the power of JavaScript with our intuitive online playground, where you can write, test, and refine your code seamlessly.

JavaScript

Pull Values From Array

In this lab, we will explore how to manipulate arrays in JavaScript by creating a function that filters out specified values from an array and mutates the original array. We will make use of built-in Array methods such as filter(), includes(), and push() to achieve this functionality. By the end of this lab, you will have a better understanding of how to manipulate arrays in JavaScript.

JavaScript

Array Without Last Element

In this lab, we will explore how to manipulate arrays in JavaScript by creating a function that returns all the elements of an array except the last one. We will use the Array.prototype.slice() method to achieve this and learn how to slice and extract elements from arrays. This lab will help us understand the fundamentals of working with arrays in JavaScript.

JavaScript

Array Is Contained in Other Array

In this lab, we will explore how to check if one array is contained in another array in JavaScript. We will use various array methods such as for...of, Set, some(), and filter() to write a function that can determine if the elements of the first array are present in the second array, regardless of their order. This lab will help you understand how to manipulate arrays in JavaScript and write efficient code to solve common programming problems.

JavaScript

Pluck Values From Array of Objects

In this lab, we will be working on a JavaScript programming exercise that involves extracting values from an array of objects. Specifically, we will be writing a function that takes in an array of objects and a key and returns an array of values corresponding to that key. This exercise will help improve your understanding of functional programming concepts and array manipulation in JavaScript.

JavaScript

Vector Angle Calculation in JavaScript

In this lab, we will explore the concept of vector angle and learn how to calculate the angle between two vectors using JavaScript. We will use various mathematical functions such as Math.pow(), Math.sqrt(), and Math.acos() to perform the necessary calculations and derive the desired result. Through this lab, we will gain a better understanding of vector operations and their practical applications.

JavaScript

Unfold Function in JavaScript

In this lab, we will explore the unfold() function in JavaScript. This function allows us to create an array by repeatedly calling an iterator function with an initial seed value until the function returns false. Through this lab, we will learn how to use the unfold() function and how it can be used to simplify certain programming tasks.

JavaScript

JavaScript Event Introduction

Welcome to the JavaScript documentation! This lab will give you an introduction to events.

JavaScript

Calculating Euclidean Vector Distance in JavaScript

In this lab, we will dive into the world of JavaScript programming and explore the concept of vector distance. The purpose of the lab is to help you understand how to use Array.prototype.reduce(), Math.pow(), and Math.sqrt() to calculate the Euclidean distance between two vectors. By the end of the lab, you will have gained practical experience in implementing this useful function in JavaScript.

JavaScript

Ungroup Array Elements Based on Function

In this lab, we will explore how to ungroup array elements based on a provided function. We will use the unzipWith() function, which takes an array produced by the zip() function and applies the provided function to ungroup the elements. By the end of this lab, you will have a better understanding of how to manipulate arrays and perform custom operations on their elements.

JavaScript

Calculating Weighted Averages in JavaScript

In this lab, we will explore how to calculate the weighted average of two or more numbers using JavaScript. We will be using the Array.prototype.reduce() method to create the weighted sum of the values and the sum of the weights, and then divide them with each other to get the weighted average. This lab will help you understand the concept of a weighted average and how to implement it in JavaScript.

JavaScript

Validating Numbers in JavaScript

In this lab, we will explore a JavaScript function that checks whether a given value is a number. We will use the parseFloat() method to convert the value to a number and then validate it using Number.isNaN() and Number.isFinite(). We will also use coercion to check if the value is a number. By the end of this lab, you will have a better understanding of how to validate numbers in JavaScript.

JavaScript

Unwinding Object Arrays in JavaScript

In this lab, we will explore the unwind function in JavaScript. The purpose of this function is to produce an array of objects from an object and one of its array-valued properties. By using object destructuring and Array.prototype.map(), we can create an array of objects where each object contains the original object's values, except for the specified key which is mapped to its individual values. Through this lab, we will gain a deeper understanding of how to manipulate and extract data from objects in JavaScript.

JavaScript

Word Wrap String

In this lab, we will be exploring the concept of string manipulation in JavaScript. Specifically, we will be focusing on the wordWrap function which allows us to wrap a string to a given number of characters using a string break character. By the end of this lab, you will have a better understanding of how to manipulate strings in JavaScript to achieve specific formatting requirements.

JavaScript

Check if Value Is of Type

In this lab, we will explore a JavaScript function that checks whether a provided value is of a specified type. We will use the is() function, which leverages the constructor property and Array.prototype.includes() method to determine if the value is of the specified type. This lab will help you gain a better understanding of type checking in JavaScript.

JavaScript

Weighted Random Sampling in JavaScript

In this lab, we will explore a practical implementation of a weighted sample function in JavaScript. The function returns a random element from an array, with probabilities assigned to each element based on the provided weights. Through this lab, we will learn how to use Array methods such as reduce() and findIndex() along with Math.random() to generate the desired outcome.

JavaScript

Generating Unique Identifiers in JavaScript

In this lab, we will explore how to generate a UUID in a browser using JavaScript. A UUID (Universally Unique Identifier) is a 128-bit value used to identify resources in a system in a way that is both unique and universal. By the end of this lab, you will have a clear understanding of how to generate a compliant UUID that can be used in your web applications.

JavaScript

- Prev
- 1
- 2
- 3
- 4
- 5
- 6
- ...
- 28
- Next