Uploaded by Robert Pugayan

Learning Sheet ICT 10-2 week 12

advertisement
Learning Sheet ICT 10
JavaScript Boolean
JavaScript Boolean
JavaScript Boolean is an object that represents value in two states: true or false. You
can create the JavaScript Boolean object by Boolean() constructor as given below.
1. Boolean b=new Boolean(value);
The default value of JavaScript Boolean object is false.
JavaScript Boolean Example
1. <script>
2. document.write(10<20);//true
3. document.write(10<5);//false
4. </script>
JavaScript Boolean Properties
Property
Description
constructor
returns the reference of Boolean function that created Boolean
object.
prototype
enables you to add properties and methods in Boolean prototype.
JavaScript Boolean Methods
Method
Description
toSource()
returns the source of Boolean object as a string.
toString()
converts Boolean into String.
valueOf()
converts other type into Boolean.
Learning Objectives:
1. Perform programming using JavaScript Boolean.
Activity 01:
Directions: Create a JS Boolean Programming that will result to a true
statement, then a false statement.
Activity 1: Rubrics
Point
Descript
s
ion
10
The student successfully executes the program without guidance or supervision.
9
8
7
5
The student successfully executes the program with very little supervision and
guidance.
The student successfully executes the program with moderate supervision and
guidance.
The student was not able to execute the program but shows eagerness to accomplish
the activity.
The student was not able to execute the program due to lack of interest in the activity.
Prepared by:
Robert S. Pugayan Jr.
TLE Subject Teacher
Noted:
_______________________
Download