Embarking on your JavaScript journey? The 'JavaScript' Skill Tree at LabEx is your definitive guide, designed to transform you from a beginner into a confident web developer. Forget passive video lectures; our interactive, hands-on labs provide a clear roadmap to mastering core concepts, DOM manipulation, and asynchronous programming. You'll write real code in an interactive JS playground, tackling practical challenges that build tangible skills. Ready to create dynamic web applications? Let's dive into some foundational labs that will kickstart your expertise.
Binary Tree Equality Check
Difficulty: Beginner | Time: 5 minutes
In this challenge, we will work with binary trees. Our objective is to create a function, known as isSameTree, that accepts the roots of two binary trees, namely p and q, and establishes if they are identical. For binary trees to be the same, they must have identical structures and node values. We will receive sample inputs and expected output data to confirm the accuracy of our function.
Practice on LabEx → | Tutorial →
Determine Data Type Accurately
Difficulty: Beginner | Time: 5 minutes
In this challenge, we'll create a getType function to accurately determine the data type of an input and return it as a string. The function should handle different data types like boolean, number, string, bigint, null, undefined, symbol, array, object, function, date, regexp, error, map, set, weakmap, and weakset. It's important that the function is correctly implemented and exported as specified. Let's begin by creating the getType.js file and writing the function.
Practice on LabEx → | Tutorial →
Reverse String Array
Difficulty: Beginner | Time: 5 minutes
In this challenge, we will receive a string array and must reverse its elements in-place, without the use of extra space. This entails modifying the input array itself to reach the desired outcome. Our solution will involve writing a function named reverseString, exporting it to solve the problem. The function needs to accept an array s as input and reverse its elements. Please note that the test cases impose certain restrictions regarding the array length and allowed characters.
Practice on LabEx → | Tutorial →
Sum of Left Leaves
Difficulty: Beginner | Time: 5 minutes
In this challenge, we will write a function called sumOfLeftLeaves that takes the root of a binary tree as input and returns the sum of all left leaves. Ensure that the function is correctly exported and traverses the tree to calculate the sum of the values of all the left leaves.
Practice on LabEx → | Tutorial →
Template String Parsing Implementation
Difficulty: Beginner | Time: 5 minutes
In this challenge, the task is to develop a template string parser by creating a function named strRender. The said function accepts a template string and a data object as parameters and must return a new string, replacing the variables in the template. The challenge setup will provide you with the code structure and example inputs/outputs to help guide your implementation.
Practice on LabEx → | Tutorial →
These hands-on labs are more than just exercises; they're stepping stones to becoming a proficient JavaScript developer. Each challenge is designed to solidify your understanding and build practical skills that are immediately applicable in real-world web development. Dive in, experiment, and watch your coding abilities flourish!