dev2 – promises problem set

You will need the completed solution to last week’s advanced array methods problem set to complete this week’s problem set. Create a copy of that solution’s HTML / JS pair and rename them promises.html / promises.js. You will need to add to that completed code solutions to the following:

//Write a new promise saved as fetchStudents that checks if the variable students exists. It resolves with the value of students and rejects with a string value "couldn't find students. try again"

//your solution

//Using .then and .catch syntax call fetchStudents and console.log the students array or console.log the error message.
//for example if students is not commented out, the entire array will logged or if it is commented out, the error message is logged in the console.

//your solution

//Using .then chaining and .catch syntax call fetchStudents 
//and using our student array method functions
//then return the students enrolled
//then return the students that have taken CT 101
//then console.log those students
//catch if students doesn't exist

//your solution

Leave a comment

Your email address will not be published. Required fields are marked *