Okay.. It's time to discuss again .JavaScript III! It's our time to listen . Haha. After typing on notepad, Sir Peralta was going to start discussing about our lesson. He continue discussing what we've done last week.
Okay. Are you ready to listen ?? haha. Are you willing to learn some of the explanation what will Sir gonna discuss? Ooh, common.! Be ready ! Need to listen first so that you will understand the lesson clearly..
Here are the lesson that I've learned after the discussion:
It's all about CONDITIONAL OPERATOR. Did you know what conditional operator means??Here....
Conditional Operator
It is called a ternary operator because it requires three operands. It is often used as a shorthand method for if/else conditional statements.
Format: conditional expression ? expression : expression
Examples:
x ? y : z If x evaluates to true, the value of the expression becomes y, else the value of the expression becomes z.
big = (x > y) ? x : y If x is greater than y, x is assigned to variable big, else y is assigned to variable big.
Also, about the Datatype conversion.
JavaScript provides three methods to convert the primitive data types. They are:
- String ()
- Numeric()
- Boolean()
That's all for this week! Thannks!
-chartine:p
Walang komento:
Mag-post ng isang Komento