Practise JavaScript String, Array and customized objects. alsko show the photo of output. Important note: (1) Create
Question:
Practise JavaScript String, Array and customized objects. alsko show the photo of output. Important note: (1) Create a JavaScript file (name it: a2.js). Add the following comment declaration with your info at the top of your code: (1 mark) /************************** * Assignment 2 * I declare that this assignment is my own work in accordance with Seneca AcademicPolicy. * No part of this assignment has been copied manually or electronically from any othersource * (including web sites) or distributed to otherstudents. * Name: Student ID: Date: **************************/ (2) In a2.js, implement the following two tasks. Provide clear comments for each question, e.g., // Task1: a. , // Task2: a. Task 1: (5 marks) Create an array of objects called courses. Each course in the array should have the following information: code name hours url APC100 Applied professional communication 3 http:/www.senecacollege.ca IPC144 Introduction to C programming null http:/www.senecacollege.ca/ipc ULI101 Linux and the Internet 4 http:/www.senecacollege.ca/lin IOS110 Windows Operating System 4 http:/www.senecacollege.ca/ios EAC150 College English 3 null a. Using appropriate array method, Remove the last course object from the given array courses and store the removed object to a variable. b. On the console, show the course which was removed from the array in step a. Refer to the sample output. Sample output:
The last course in the array is: code: EAC150, name: College English
c. Create another course object WEB222, which has the same properties as the objects (in the course array). Its values are as follows:
code: "WEB222", name:"Web Programming Principles", hours: 4, url: "http:/www.senecacollege.ca/web"
d. Add the course object WEB222 to the end of the courses array.
e. Use for loop to loop through the course array in order to add the hours of the courses and log the total hours in the console. Refer to the following sample output.
Note: Do not hard code the length of the array. Your program should be easily to extend to 30 courses or more. Use the array property length. Sample output: Total hours for all courses: 15 hours.