Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
Loading…
Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.
JAVASCRIPT TEXT / CHAPTER 03 / Learn / LESSON 03
Third class. Real labels often arrive as one string with a separator.
split(sep) breaks a string into an array. join(sep) is an array method: it glues elements with a separator between them.
Mini example:
const line = "food,rent,fun"; const parts = line.split(","); console.log(parts.join("-"));
Common mistake: looking for join on the string (in JS join lives on arrays); or mixing up the separator for split versus join.
join is an array method.
DATA STANDBY
›