Open In App

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: 




// Defining underscore contrib variable
var _ = require('underscore-contrib'); 
  
var bZ  = _.bitwiseZ( 1 );
  
console.log("The bitwiseZ is :",bZ);

Output:

The bitwiseZ is : 1

Example 2:




// Defining underscore contrib variable
var _ = require('underscore-contrib'); 
  
var bZ  = _.bitwiseZ( 1, 3 );
  
console.log("The bitwiseZ is :",bZ);

Output:

The bitwiseZ is : 0

Example 3: 




// Defining underscore contrib variable
var _ = require('underscore-contrib'); 
  
var bZ  = _.bitwiseZ( 72, 32 );
  
console.log("The bitwiseZ is :",bZ);

Output:

The bitwiseZ is : 72

Example 4: 




// Defining underscore contrib variable
var _ = require('underscore-contrib'); 
  
var bZ  = _.bitwiseZ( 72, 32, 2 );
  
console.log("The bitwiseZ is :",bZ);

Output:

The bitwiseZ is : 18

Article Tags :