HOTSPOT
You are developing an online shopping application that accepts credit cards for payment.
If the credit card number is invalid, the application must:
Generate an error
Assign “200” to the error number
Assign “Invalid” to the error description
You need to write the code that meets the requirements.
How should you write the code? (To answer, select the appropriate option from the drop-down list in the answer area.)
A.
answer is throw-Error-200-Invalid
are you sure this is the correct answer?
Yes
pablo is right
Pablo is right, I tried this out in VS.NET 2012
throw new Error(“Invalid”, 200); also works
throw new Error(200,”Invalid”);
This is the correct option for the exam from html5 point of view.
but in misrosoft site provided example
throw new Error(200, “x equals zero”);
you must make (200, “error”), this is for IE. For all other browsers it’s (“error, 200) but because it’s microsoft’s exam I suggest to use the IE’s one 🙂
try {
throw new Error(200, “x equals zero”);
}
catch (e) {
document.write(e.message);
}
Here are some hyperlinks to sites that we link to due to the fact we believe they may be worth visiting.
One of our visitors not long ago proposed the following website.
always a large fan of linking to bloggers that I really like but really don’t get quite a bit of link appreciate from
Sites of interest we’ve a link to