Given the following object, write an area
function in JavaScript that calculates the area of triangle
:
var triangle = {
sideA: 3,
sideB: 4,
sideC: 5
};
Create an array that contains a few of your favorite things (fruits, vegetables, colors, sports teams, whatever). Write some code in JavaScript that outputs strings like (for an array of arbitrary length):
My #1 favorite baseball team is the New York Mets.
My #2 favorite baseball team is the San Francisco Giants.
Change the output to:
My 1st favorite baseball team is the New York Mets.
My 2nd favorite baseball team is the San Francisco Giants.
Create a calculator in JavaScript.
- Prompt the user to enter an operator and two operands.
- Support the following operations: addition, subtraction, multiplication, and division.
- Output may appear in the console or in an alert.
- Support the modulus operator.
- Support the square root operator.
- Support more than two operands.