More Array methods

Someone has hacked your online pizza order! Fortunately, you can hack it back into shape. The pizza place has sophisticated anti-hacking measures, so you can't simply redefine the array, but you can use indexOf and splice to remove the toppings you don't like and add the ones you do from the following array:

More fun: emulating array functions

Write a function called myPush which receives an array and a value, and then behaves just like ordinary push: it should append the value to the array and return its new length. Avoid using the built-in push method in your implementation.

Write a function called muyPush which receives two arrays, pushes all the elements of the second array onto the end of the first, and returns the new length of the first.

Write a function called myConcat which receives two arrays and returns a new array comprising a copy of the first with a copy of the second appended to the end. Neither of the input arrays should change. Avoid using built-in concat in your implementation.

assert

Write a function called assert which will receive parameters claim and warning.
claim is the result of a Boolean expression, and if claim is not truthy, assert should console.log the string stored in parameter warning.

Assertions as tests

Write a series of assertions that will use the card functions that you wrote yesterday. They should pass values into those functions and check to see if the functions are returning what you think they should be, for example:

assert((rank(3) === 1), "Card id 3 should be rank 1, but it isn't!");

Include these assertions in your cards code and use them to be sure that all of your card functions are working as intended. Talk with your group about any surprising edge cases that you found: did any assertions indicate a function wasn't working when it was, or vice versa? Look at each other's assertions and come up with ways to break the card functions in such a way that the assertions don't give any warnings.

String and array manipulation

Write assertions that test a function that will take in an array of strings, where each string represents a name and an address formatted like so:

["Sherlock Holmes; 221-B Baker St.; London, England NW16XE"]

It should return a different array of strings, formatted like:

["Holmes, Sherlock: NW16XE"]

Now write the function! For starters, use the following array as a source: