

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Node.js – util.types.isInt32Array() Method
<p style="">The <strong>util.types.isInt32Array()</strong> method checks whether the passed value is a built-in <strong>Int32Array</strong> instance or not. If the above condition is satisfied, it returns True, else False.</p><h2>Syntax</h2><pre class="result notranslate">util.types.isInt32Array(value)</pre><h2>Parameters</h2><ul class="list"><li><p><strong>value − </strong>This input takes input for the required parameter and checks if it's an <strong>Int32Array</strong> instance or not. Returns True or False based upon the input value passed.</p></li></ul><h2>Example 1</h2><p>Create a file with name <strong>isInt32Array.js</strong> and copy the below code snippet.</p><p style="">After creating the file, use the following command to run this code and check the output -</p><pre class="result notranslate">node isInt32Array.js</pre><h3 style="">Program Code</h3><!--<p><a href="" target="_blank" rel="nofollow" class="demo"><i class="fa-external-link"></i> Live Demo</a></p>--><pre class="prettyprint notranslate">// util.types.isInt32Array() Demo Example // Importing the util module const util = require('util'); // Passing normal Int32-Array as input value console.log("1." + util.types.isInt32Array(new Int32Array())); // Passing a Array buffer as input console.log("2." + util.types.isInt32Array(new ArrayBuffer())); // Passing a Float64 array as input console.log("3." + util.types.isInt32Array(new Int16Array()));</pre><h2>Output</h2><pre class="result notranslate">C:\home ode>> node isInt32Array.js 1.true 2.false 3.false</pre><h2>Example 2</h2><!--<p><a href="" target="_blank" rel="nofollow" class="demo"><i class="fa-external-link"></i> Live Demo</a></p>--><pre class="prettyprint notranslate">// util.types.isInt32Array() Demo Example // Importing the util module const util = require('util'); // Defining int32 array in multiple ways var int32 = new Int32Array(2); int32[0] = 42; var arr = new Int32Array([21,31]); console.log(arr[1]); // From an ArrayBuffer var buffer = new ArrayBuffer(32); var z = new Int32Array(buffer, 0, 4); // From an iterable var iterable = function*(){ yield* [1,2,3]; }(); var arr1 = new Int32Array(iterable); // Passing int32 Array with values as input console.log("1." + util.types.isInt32Array(int32)); // Passing a int32 array 0th value as input console.log("2." + util.types.isInt32Array(arr)); // Passing a int32 array defined by array buffer console.log("3." + util.types.isInt32Array(z)); // Passing a int32 array defined by iterable console.log("4." + util.types.isInt32Array(arr1));</pre><h2>Output</h2><pre class="result notranslate">C:\home ode>> node isInt32Array.js 31 1.true 2.true 3.true 4.true</pre>
- Related Questions & Answers
- How to use jQuery.getScript() method to load external js files?
- How to include multiple js files using jQuery $.getScript() method?
- HTML5 / JS storage event handler
- SVG morphing in React JS
- JS Geolocation but without prompting possible?
- Why do I need Babel JS?
- Adding Lottie animation in React JS
- SVG drawing in React JS frontend
- Why is isNaN(null) == false in JS?
- Selecting database inside the JS in MongoDB?
- Convert JS array into an object - JavaScript
- Creating a Particle Animation in React JS
- Creating a Customizable Modal in React JS
- Creating animated loading skeletons in React JS
- Finding next greater node for each node in JavaScript
- Node in Javascript
Advertisements