// Array representing a to-do list
const todoList = ['Task 1', 'Task 2', 'Task 3'];
// Display the to-do list using the join method
console.log('To-Do List:', todoList.join(', '));
code
JavaScript Display To-Do List
This JavaScript code uses the join method to concatenate the elements of the todoList array into a single string, separated by commas and a space. The resulting string is then displayed in the console. The comments provide explanations for each part of the code.
Array
To-Do List
join Method