![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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.isUint16Array() Method
The util.types.isUint16Array() method checks whether the passed value is a builtin Uint16Array instance or not. If the above condition is satisfied, it returns True, else False.
Syntax
util.types.isUint16Array(value)
Parameters
It takes a single parameter −
value − This input value takes input for the required parameter and checks if it's a Uint16Array instance or not.
It returns True or False based upon the input value passed.
Example 1
Create a file with the name "isUint16Array.js" and copy the following code snippet. After creating the file, use the command "node isUint16Array.js" to run this code.
// util.types.isUint16Array() Demo Example // Importing the util module const util = require('util'); // Passing normal Array as input value console.log("1." + util.types.isUint16Array(new ArrayBuffer())); // Passing a Uint16 array as input console.log("2." + util.types.isUint16Array(new Uint16Array())); // Passing a Float64 array as input console.log("3." + util.types.isUint16Array(new Float64Array()));
Output
C:\home
ode>> node isUint16Array.js 1.false 2.true 3.false
Example 2
Let’s have a look at one more example
// util.types.isUint16Array() Demo Example // Importing the util module const util = require('util'); // Initialising the Uint16Array with values var arr = new Uint16Array([1, 5, 8, 1, 95]); // Passing Uint16 Array with values as input console.log("1." + util.types.isUint16Array(arr)); // Passing a Uint16 array 0th value as input console.log("2." + util.types.isUint16Array(arr[0]));
Output
C:\home
ode>> node isBigInt64Array.js 1.true 2.false
Advertisements