From 30cac8cbd768c1b7e33d6fd23e8d1e89e01fce54 Mon Sep 17 00:00:00 2001 From: Karumanchi831 Date: Thu, 9 Oct 2025 17:06:40 -0500 Subject: [PATCH] Update the-string-dot-length-property.js --- the-string-dot-length-property.js | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/the-string-dot-length-property.js b/the-string-dot-length-property.js index bfd2591..afeecd7 100644 --- a/the-string-dot-length-property.js +++ b/the-string-dot-length-property.js @@ -1,30 +1,18 @@ -/* -Objective: -Practice using the .length property by calculating the length of -multiple predefined strings and assigning the results to specific variables. - -Instructions: -You will be provided with several predefined string variables. -Your task is to: - - Use the .length property to calculate the length of each string. - - Assign the length of each string to its corresponding length variable. - - Ensure that each length variable contains the correct value. - -*/ - -// Starter Code (Pre-filled): -// Predefined strings +// Your code here let stringOne = "Coding Bootcamp"; let stringTwo = "JavaScript"; let stringThree = ""; // Your task: Assign the length of each string to the corresponding variable -let lengthOne; // Length of stringOne -let lengthTwo; // Length of stringTwo -let lengthThree; // Length of stringThree - -// Your code here +let lengthOne = stringOne.length; // Length of stringOne +let lengthTwo = stringTwo.length; // Length of stringTwo +let lengthThree = stringThree.length; // Length of stringThree + +// Optional: Print the lengths to verify +console.log("Length of stringOne:", lengthOne); +console.log("Length of stringTwo:", lengthTwo); +console.log("Length of stringThree:", lengthThree);