Question: 4. Create a function named addBid(). The purpose of this function is to add a bid to the start of the bids, bidders, and bidTime

4. Create a function named addBid(). The purpose of this function is to add a bid to the start of the bids, bidders, and bidTime arrays. Add the following commands: a. Using the unshift() array method, insert the current value of the bidId field to the start of the bidders array. b. Use the unshift() array method to insert the current value of the bidAmount field at the start of the bids array. c. Declare a variable named nowcontaining a date object for the current date and time. d. Extract the hours, minutes, and seconds values from the now variable, storing these values in variables named hours, minutes, and seconds. e. Use a conditional operator to insert leading zeroes in the minutes and seconds values if they are less than 10. f. Create a variable named timeText equal to the text [hours:minutes:seconds] where hours, minutes, and seconds are the values of the hours, minutes, and seconds variables. g. Using the unshift() array method, insert the value of the timeText variable at the start of the bidTime array.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!