Using the array of objects included below, create the following functions:
A function to display the current contents of the array
Tip: Use a for-of loop, concatenating array fields e.g. "employee.name"
A function to sort the array by extension
Tip: a.extension - b.extension
A function to sort the array by employee name
Tip: a.name.localeCompare(b.name)
Stretch Goal:
Add a function that can add new employees to the array using prompt() and push()
Example: .push({ name: name, office: office, extension: parseInt(extension) });
Using the array of objects included below, create the following functions:
a.extension - b.extension
a.name.localeCompare(b.name)
Stretch Goal:
.push({ name: name, office: office, extension: parseInt(extension) });
Array: