Slice a String
Slice a String
slice returns part of a string without changing the original. The start index is included, and the end index is not included.
Your task: The lesson code has a short prefix followed by a number. Create prefix and lessonNumber from the provided code, then log both pieces.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Slice a String
slice returns part of a string without changing the original. The start index is included, and the end index is not included.
Your task: The lesson code has a short prefix followed by a number. Create prefix and lessonNumber from the provided code, then log both pieces.