Answered step by step
Verified Expert Solution
Question
1 Approved Answer
const courses = [{ prefix: 'ITIS', id: 4166, title: 'Network based app development' }, { prefix: 'ITIS', id: 4180, title: 'Mobile application development' }, {
const courses = [{ prefix: 'ITIS', id: 4166, title: 'Network based app development' }, { prefix: 'ITIS', id: 4180, title: 'Mobile application development' }, { prefix: 'ITCS', id: 4156, title: 'Intro to machine learning' }, { prefix: 'ITCS', id: 3160, title: 'Database desgin' } ]; //return a course that matches the id function findById(id) { return courses.find(course => course.id === id); } //To do: implement save(course) //To do: implement findByPrefix(prefix) //To do: implement updateById(id, course) //To do: implement removeById(id) //To do: uncomment the following testing code when you are ready to test your functions // save({ prefix: 'ITIS', id: 3310, title: 'Software architecture & design' }); // save({ prefix: 'ITIS', id: 4250, title: 'Computer forensics' }); // save({ prefix: 'ITIS', id: 4420, title: 'Usable security and privacy' }); // console.log(courses); // console.log(findById(4166)); // console.log(findByPrefix('ITIS')); // console.log(removeById(4000)); // console.log(updateById(4000)); // console.log(updateById(4166, { // prefix: 'ITIS', // id: 4166, // title: 'Network-based app development' // }, )); // console.log(removeById(4420)); // console.log(courses);
please need help with this thank you
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started