Python Institute JSA-41-01 Practice Exams
Last updated on Oct 22,2026- Exam Code: JSA-41-01
- Exam Name: JSA - Certified Associate JavaScript Programmer
- Certification Provider: Python Institute
- Latest update: Oct 22,2026
You have an array of tasks, where each task is an object with properties id, title, and completed. Write a JavaScript function that returns a new array containing only the titles of the tasks that are not completed, sorted alphabetically.
Which of the following functions correctly implements this?
- A . function getIncompleteTaskTitles(tasks) { return tasks.sort((a, b) => a.title.localeCompare(b.title))
.filter(task => !task.completed) .map(task => task.title);} - B . function getIncompleteTaskTitles(tasks) { return tasks.filter(task => task.completed) .map(task => task.title) .sort((a, b) => a.localeCompare(b));}
- C . function getIncompleteTaskTitles(tasks) { return tasks.map(task => task.title) .filter(task => !task.completed) .sort((a, b) => a.localeCompare(b));}
- D . function getIncompleteTaskTitles(tasks) { return tasks.filter(task => !task.completed) .sort((a, b) =>
a.title.localeCompare(b.title)) .map(task => task.title);}
You have an array of tasks, where each task is an object with properties id, title, and completed. Write a JavaScript function that returns a new array containing only the titles of the tasks that are not completed, sorted alphabetically.
Which of the following functions correctly implements this?
- A . function getIncompleteTaskTitles(tasks) { return tasks.sort((a, b) => a.title.localeCompare(b.title))
.filter(task => !task.completed) .map(task => task.title);} - B . function getIncompleteTaskTitles(tasks) { return tasks.filter(task => task.completed) .map(task => task.title) .sort((a, b) => a.localeCompare(b));}
- C . function getIncompleteTaskTitles(tasks) { return tasks.map(task => task.title) .filter(task => !task.completed) .sort((a, b) => a.localeCompare(b));}
- D . function getIncompleteTaskTitles(tasks) { return tasks.filter(task => !task.completed) .sort((a, b) =>
a.title.localeCompare(b.title)) .map(task => task.title);}
You have an array of tasks, where each task is an object with properties id, title, and completed. Write a JavaScript function that returns a new array containing only the titles of the tasks that are not completed, sorted alphabetically.
Which of the following functions correctly implements this?
- A . function getIncompleteTaskTitles(tasks) { return tasks.sort((a, b) => a.title.localeCompare(b.title))
.filter(task => !task.completed) .map(task => task.title);} - B . function getIncompleteTaskTitles(tasks) { return tasks.filter(task => task.completed) .map(task => task.title) .sort((a, b) => a.localeCompare(b));}
- C . function getIncompleteTaskTitles(tasks) { return tasks.map(task => task.title) .filter(task => !task.completed) .sort((a, b) => a.localeCompare(b));}
- D . function getIncompleteTaskTitles(tasks) { return tasks.filter(task => !task.completed) .sort((a, b) =>
a.title.localeCompare(b.title)) .map(task => task.title);}
You have an array of tasks, where each task is an object with properties id, title, and completed. Write a JavaScript function that returns a new array containing only the titles of the tasks that are not completed, sorted alphabetically.
Which of the following functions correctly implements this?
- A . function getIncompleteTaskTitles(tasks) { return tasks.sort((a, b) => a.title.localeCompare(b.title))
.filter(task => !task.completed) .map(task => task.title);} - B . function getIncompleteTaskTitles(tasks) { return tasks.filter(task => task.completed) .map(task => task.title) .sort((a, b) => a.localeCompare(b));}
- C . function getIncompleteTaskTitles(tasks) { return tasks.map(task => task.title) .filter(task => !task.completed) .sort((a, b) => a.localeCompare(b));}
- D . function getIncompleteTaskTitles(tasks) { return tasks.filter(task => !task.completed) .sort((a, b) =>
a.title.localeCompare(b.title)) .map(task => task.title);}
You have an array of tasks, where each task is an object with properties id, title, and completed. Write a JavaScript function that returns a new array containing only the titles of the tasks that are not completed, sorted alphabetically.
Which of the following functions correctly implements this?
- A . function getIncompleteTaskTitles(tasks) { return tasks.sort((a, b) => a.title.localeCompare(b.title))
.filter(task => !task.completed) .map(task => task.title);} - B . function getIncompleteTaskTitles(tasks) { return tasks.filter(task => task.completed) .map(task => task.title) .sort((a, b) => a.localeCompare(b));}
- C . function getIncompleteTaskTitles(tasks) { return tasks.map(task => task.title) .filter(task => !task.completed) .sort((a, b) => a.localeCompare(b));}
- D . function getIncompleteTaskTitles(tasks) { return tasks.filter(task => !task.completed) .sort((a, b) =>
a.title.localeCompare(b.title)) .map(task => task.title);}
console.log(counter.decrement());
Why does the variable count retain its value between calls to increment and decrement?
- A . The count variable is reinitialized to 0 every time increment or decrement is called.
- B . The count variable is retained in the closure created by the createCounter function.
- C . The count variable is passed by reference.
- D . The count variable is a global variable.
console.log(counter.decrement());
Why does the variable count retain its value between calls to increment and decrement?
- A . The count variable is reinitialized to 0 every time increment or decrement is called.
- B . The count variable is retained in the closure created by the createCounter function.
- C . The count variable is passed by reference.
- D . The count variable is a global variable.
console.log(counter.decrement());
Why does the variable count retain its value between calls to increment and decrement?
- A . The count variable is reinitialized to 0 every time increment or decrement is called.
- B . The count variable is retained in the closure created by the createCounter function.
- C . The count variable is passed by reference.
- D . The count variable is a global variable.
console.log(myCar);
What will be the output of console.log(myCar)?
- A . { make: ‘Toyota’, model: ‘Corolla’, year: undefined }
- B . { year: 2020 }
- C . { make: ‘Toyota’, model: ‘Corolla’ }
- D . { make: ‘Toyota’, model: ‘Corolla’, year: 2020 }
console.log(myCar);
What will be the output of console.log(myCar)?
- A . { make: ‘Toyota’, model: ‘Corolla’, year: undefined }
- B . { year: 2020 }
- C . { make: ‘Toyota’, model: ‘Corolla’ }
- D . { make: ‘Toyota’, model: ‘Corolla’, year: 2020 }