Underscore.js _.bitwiseZ() Method
The _.bitwiseZ() Method returns the result of using the Bitwise >>> operator on all the arguments.
Syntax:
_.bitwiseZ( val1, val2,..., valn );
Parameters: This method takes n values to operate on them.
Return Value: This method returns the result of using the Bitwise >>> operator on all the arguments.
Note: This will not work in normal JavaScript because it requires the underscore.js contrib library to be installed.
underscore.js contrib library can be installed using npm install underscore-contrib –save.
Example 1:
Javascript
var _ = require( 'underscore-contrib' );
var bZ = _.bitwiseZ( 1 );
console.log( "The bitwiseZ is :" ,bZ);
|
Output:
The bitwiseZ is : 1
Example 2:
Javascript
var _ = require( 'underscore-contrib' );
var bZ = _.bitwiseZ( 1, 3 );
console.log( "The bitwiseZ is :" ,bZ);
|
Output:
The bitwiseZ is : 0
Example 3:
Javascript
var _ = require( 'underscore-contrib' );
var bZ = _.bitwiseZ( 72, 32 );
console.log( "The bitwiseZ is :" ,bZ);
|
Output:
The bitwiseZ is : 72
Example 4:
Javascript
var _ = require( 'underscore-contrib' );
var bZ = _.bitwiseZ( 72, 32, 2 );
console.log( "The bitwiseZ is :" ,bZ);
|
Output:
The bitwiseZ is : 18
Last Updated :
03 Aug, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...