Here is my assignment and I am a little confused. I barely know any JavaScript so this is kind of overwhelming.
Write JS code that anticipates and handles an error for an expected numeric field. This code is executed on keypress, and the entered value is saved for you in a variable called enteredChar. Include the try block of JS statements needed to check if the character is not a number or a non-alphanumeric character, or if you throw an error message.
Write a custom error handling JS function called processErrors that handles a custom error by assigning it to the onerror event handler. Include the block of JS statements needed to pass the arguments sent by the JS interpreter into the processErrors function, send an alert message with the agreements, return, and write the event handler that calls the processErrors function.