Javascript Output (a && b) => false (a || b) => true !(a && b) => true Set the variables to different values and different operators and then try... Bitwise Operators JavaScript supports the following bitwise operators: Assume variable A holds 2 and variable B holds 3, then: S.No Operator and Description & (Bitwise AND) 1 It performs a Boolean AND operation on each bit of its integer arguments. Ex: (A & B) is 2. | (BitWise OR) 2 It performs a Boolean OR operation on each bit of its integer arguments. Ex: (A | B) is 3. ^ (Bitwise XOR) 3 It performs a Boolean exclusive OR operation on each bit of its integer arguments. Exclusive OR means that either operand one is true or operand two is true, but not both. Ex: (A ^ B) is 1. 4 ~ (Bitwise Not) It is a unary operator and operates by reversing all the bits in the operand. 28
Javascript Ex: (~B) is -4. (Right Shift) 6 Binary Right Shift Operator. The left operand’s value is moved right by the number of bits specified by the right operand. Ex: (A >> 1) is 1. >>> (Right shift with Zero) 7 This operator is just like the >> operator, except that the bits shifted in on the left are always zero. Ex: (A >>> 1) is 1. Example Try the following code to implement Bitwise operator in JavaScript.
Javascript ondragenter script Trigg
Javascript onplaying script Trigger
15. COOKIES Javascript What are Coo
Javascript Enter name: Outp
Javascript Setting Cookies Expiry D
Javascript Output Enter Cookie Na
Javascript Example Try the followin
Javascript setTimeout('Redirect()',
17. DIALOG BOX Javascript JavaScrip
Javascript Output Click the fol
18. VOID KEYWORD Javascript void is
Javascript Click the followin
Javascript 2. If you do not want to
Javascript 104
Javascript Methods are useful for e
Javascript Output Book title is
Javascript User-defined objects /
Javascript In the following section
Javascript Click the following t
Javascript Day of the Month must be
Javascript alert("Value of bigNumbe
Javascript constructor It returns a
Javascript Try the following exampl
Javascript document.write(""); docu
Javascript document.write("num.toPr
Javascript Returns the primitive va
Javascript Returns the function tha
Javascript Method toSource() toStri
Javascript Output flag.toString
23. STRING Javascript The String ob
Javascript Try the following exampl
Javascript concat() indexOf() lastI
Javascript document.writeln("str.ch
Javascript Argument Details string2
Javascript lastIndexOf () This meth
Javascript var index = str1.localeC
Javascript substring. $n or $nn Whe
Javascript Search () This method ex
Javascript document.write( sliced )
Javascript Try the following exampl
Javascript Return Value Returns a s
Javascript JavaScript String toLow
Javascript var str = "Apples are r
Javascript were in a tag sup() Cau
Javascript blink () This method cau
Javascript Try the following exampl
Javascript JavaScript String font
Javascript JavaScript String link(
Javascript JavaScript String strik
Javascript JavaScript String sup(
Javascript input length prototype T
Javascript Prototype The prototype
Javascript push() reduce() reduceRi
Javascript every () Javascript arra
Javascript } var passed = [12, 5, 8
Javascript Array.prototype.filter =
Javascript } }; Example Try the fol
Javascript var len = this.length; v
Javascript join () Javascript array
Javascript var from = Number(argume
Javascript } var index = [12, 5, 8,
Javascript Array.prototype.map = fu
Javascript Its syntax is as follows
Javascript var rv = arguments[1]; }
Javascript } } throw new TypeError(
Javascript } rv = this[i--]; break;
Javascript } rv = fun.call(null, rv
Javascript Output Removed element
Javascript { } if (i in this && fun
Javascript Return Value Returns a s
Javascript toString () Javascript a
25. DATE Javascript The Date object
Javascript Return Value Returns the
Javascript Date Methods Here is a l
Javascript universal time. setUTCMo
Javascript Syntax Its syntax is as
Javascript Example Try the followin
Javascript var dt = new Date(); d
Javascript getMonth() : 11 getSecon
Javascript Syntax Its syntax is as
Javascript Try the following exampl
Javascript Output getUTCHours() :
Javascript Syntax Its syntax is as
Javascript JavaScript getYear Met
Javascript JavaScript setFullYear
Javascript If you specify a number
Javascript monthValue : An integ
Javascript setTime () Javascript da
Javascript Date.setUTCFullYear(year
Javascript document.write( dt );
Javascript Try the following exampl
Javascript Example Try the followin
Javascript var dt = new Date(1993,
Javascript toLocaleDateString () Ja
Javascript Syntax Its syntax is as
Javascript For instances of Date,
Javascript var dateobject = new
Javascript Output 743850547000 Date
Javascript minutes : An integer
Javascript In the following section
Javascript Example Try the followin
Javascript Property Value is : 0.43
Javascript JavaScript Math SQRT2 P
Javascript Try the following exampl
Javascript First Test Value : 3.141
Javascript JavaScript Math atan() M
Javascript var value = Math.atan2(+
Javascript Example Try the followin
Javascript Output First Test Value
Javascript var value = Math.log(10
Javascript min ( ) This method retu
Javascript var value = Math.pow(7,
Javascript Return Value Returns the
Javascript Output First Test Val
Javascript Example Try the followin
27. REGEXP Javascript A regular exp
Javascript Examples Following examp
Javascript m g Specifies that if th
Javascript Try the following exampl
Javascript Test1 - ignoreCase prope
Javascript if ( re.multiline ){ doc
Javascript exec ( ) The exec method
Javascript document.write("Test 2 -
Javascript document.write("Test 1 -
Javascript There are several DOMs i
Javascript forms[ ] 9 An array of F
Javascript Ex: document.close( ) op
Javascript This is main title Click
Javascript createElement( tagName)
Javascript NOTE: This example r
Javascript Specifies the loading st
Javascript NOTE: This example
Javascript Part 3: JavaScript Advan
Javascript Logical Errors Logic err
Javascript Now let us try to catch
Javascript Output Click the followi
Javascript Click the following to s
30. FORM VALIDATION Javascript Form
Javascript Basic Form Validation Fi
Javascript var emailID = document.m
Javascript Manual Animation So let'
Javascript } function moveRight(){
Javascript It is not possible to s
Javascript Output Checking for Plug
Javascript //--> If you
Javascript Error Messages in Firefo
Javascript Use a JavaScript Debugge
34. IMAGE MAP Javascript You can us
Javascript Output You can feel the
Javascript 6 plugins[] This propert
Javascript document.write(" Browser