www.w3schools.com Open in urlscan Pro
192.229.173.207  Public Scan

URL: https://www.w3schools.com/jsref/jsref_obj_typed_array.asp
Submission: On November 16 via api from US — Scanned from US

Form analysis 1 forms found in the DOM

/action_page.php

<form class="search_in_content" action="/action_page.php">
  <input type="text" placeholder="Search..." id="search2" autocomplete="off" onkeydown="key_pressed_in_search(this, event)" oninput="find_search_results(this)" onfocus="find_search_results(this);">
</form>

Text Content

Tutorials References Exercises Videos Menu

Log in
Free Website Get Certified Upgrade


HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP BOOTSTRAP HOW TO W3.CSS C C++ C# REACT R
JQUERY DJANGO TYPESCRIPT NODEJS MYSQL   
Dark mode
Dark code
×



TUTORIALS


HTML AND CSS

Learn HTML Learn CSS Learn RWD Learn Bootstrap Learn W3.CSS Learn Colors Learn
Icons Learn Graphics Learn SVG Learn Canvas Learn How To Learn Sass


DATA ANALYTICS

Learn AI Learn Machine Learning Learn Data Science Learn NumPy Learn Pandas
Learn SciPy Learn Matplotlib Learn Statistics Learn Excel


XML TUTORIALS

Learn XML Learn XML AJAX Learn XML DOM Learn XML DTD Learn XML Schema Learn XSLT
Learn XPath Learn XQuery


JAVASCRIPT

Learn JavaScript Learn jQuery Learn React Learn AngularJS Learn JSON Learn AJAX
Learn AppML Learn W3.JS


PROGRAMMING

Learn Python Learn Java Learn C Learn C++ Learn C# Learn R Learn Kotlin Learn Go
Learn Django Learn TypeScript


SERVER SIDE

Learn SQL Learn MySQL Learn PHP Learn ASP Learn Node.js Learn Raspberry Pi Learn
Git Learn MongoDB Learn AWS Cloud


WEB BUILDING

Create a Website NEW Where To Start Web Templates Web Statistics Web
Certificates Web Development Code Editor Test Your Typing Speed Play a Code Game
Cyber Security Accessibility Join our Newsletter


DATA ANALYTICS

Learn AI Learn Machine Learning Learn Data Science Learn NumPy Learn Pandas
Learn SciPy Learn Matplotlib Learn Statistics Learn Excel Learn Google Sheets


XML TUTORIALS

Learn XML Learn XML AJAX Learn XML DOM Learn XML DTD Learn XML Schema Learn XSLT
Learn XPath Learn XQuery

×



REFERENCES


HTML

HTML Tag Reference HTML Browser Support HTML Event Reference HTML Color
Reference HTML Attribute Reference HTML Canvas Reference HTML SVG Reference
Google Maps Reference


CSS

CSS Reference CSS Browser Support CSS Selector Reference Bootstrap 3 Reference
Bootstrap 4 Reference W3.CSS Reference Icon Reference Sass Reference


JAVASCRIPT

JavaScript Reference HTML DOM Reference jQuery Reference AngularJS Reference
AppML Reference W3.JS Reference


PROGRAMMING

Python Reference Java Reference


SERVER SIDE

SQL Reference MySQL Reference PHP Reference ASP Reference


XML

XML DOM Reference XML Http Reference XSLT Reference XML Schema Reference


CHARACTER SETS

HTML Character Sets HTML ASCII HTML ANSI HTML Windows-1252 HTML ISO-8859-1 HTML
Symbols HTML UTF-8

×



EXERCISES AND QUIZZES


EXERCISES

HTML Exercises CSS Exercises JavaScript Exercises Python Exercises SQL Exercises
PHP Exercises Java Exercises C Exercises C++ Exercises C# Exercises jQuery
Exercises React.js Exercises MySQL Exercises Bootstrap 5 Exercises Bootstrap 4
Exercises Bootstrap 3 Exercises NumPy Exercises Pandas Exercises SciPy Exercises
TypeScript Exercises Excel Exercises R Exercises Git Exercises Kotlin Exercises
Go Exercises MongoDB Exercises


QUIZZES

HTML Quiz CSS Quiz JavaScript Quiz Python Quiz SQL Quiz PHP Quiz Java Quiz C
Quiz C++ Quiz C# Quiz jQuery Quiz React.js Quiz MySQL Quiz Bootstrap 5 Quiz
Bootstrap 4 Quiz Bootstrap 3 Quiz NumPy Quiz Pandas Quiz SciPy Quiz TypeScript
Quiz XML Quiz R Quiz Git Quiz Kotlin Quiz Cyber Security Quiz Accessibility Quiz


COURSES

HTML Course CSS Course JavaScript Course Front End Course Python Course SQL
Course PHP Course Java Course C++ Course C# Course jQuery Course React.js Course
Bootstrap 4 Course Bootstrap 3 Course NumPy Course Pandas Course TypeScript
Course XML Course R Course Data Analytics Course Cyber Security Course
Accessibility Course


CERTIFICATES

HTML Certificate CSS Certificate JavaScript Certificate Front End Certificate
Python Certificate SQL Certificate PHP Certificate Java Certificate C++
Certificate C# Certificate jQuery Certificate React.js Certificate MySQL
Certificate Bootstrap 5 Certificate Bootstrap 4 Certificate Bootstrap 3
Certificate TypeScript Certificate XML Certificate Excel Certificate Data
Science Certificate Cyber Security Certificate Accessibility Certificate

×

Tutorials

References

Exercises

Get Certified Upgrade Spaces Videos Shop




JS REFERENCE

JS by Category JS by Alphabet



JAVASCRIPT

JS Array
concat() constructor copyWithin() entries() every() fill() filter() find()
findIndex() forEach() from() includes() indexOf() isArray() join() keys()
lastIndexOf() length map() pop() prototype push() reduce() reduceRight()
reverse() shift() slice() some() sort() splice() toString() unshift() valueOf()
JS Boolean
constructor prototype toString() valueOf()
JS Classes
constructor() extends static super
JS Date
constructor getDate() getDay() getFullYear() getHours() getMilliseconds()
getMinutes() getMonth() getSeconds() getTime() getTimezoneOffset() getUTCDate()
getUTCDay() getUTCFullYear() getUTCHours() getUTCMilliseconds() getUTCMinutes()
getUTCMonth() getUTCSeconds() now() parse() prototype setDate() setFullYear()
setHours() setMilliseconds() setMinutes() setMonth() setSeconds() setTime()
setUTCDate() setUTCFullYear() setUTCHours() setUTCMilliseconds() setUTCMinutes()
setUTCMonth() setUTCSeconds() toDateString() toISOString() toJSON()
toLocaleDateString() toLocaleTimeString() toLocaleString() toString()
toTimeString() toUTCString() UTC() valueOf()
JS Error
name message
JS Global
decodeURI() decodeURIComponent() encodeURI() encodeURIComponent() escape()
eval() Infinity isFinite() isNaN() NaN Number() parseFloat() parseInt() String()
undefined unescape()
JS JSON
parse() stringify()
JS Math
abs() acos() acosh() asin() asinh() atan() atan2() atanh() cbrt() ceil() clz32()
cos() cosh() E exp() expm1() floor() fround() LN2 LN10 log() log10() log1p()
log2() LOG2E LOG10E max() min() PI pow() random() round() sign() sin() sinh()
sqrt() SQRT1_2 SQRT2 tan() tanh() trunc()
JS Number
constructor EPSILON isFinite() isInteger() isNaN() isSafeInteger()
MAX_SAFE_INTEGER MIN_SAFE_INTEGER MAX_VALUE MIN_VALUE NaN NEGATIVE_INFINITY
POSITIVE_INFINITY parseFloat() parseInt() prototype toExponential() toFixed()
toLocaleString() toPrecision() toString() valueOf()
JS Object
constructor keys() prototype toString() valueOf()
JS Operators JS Precedence JS RegExp
Modifiers: g i m Groups: [abc] [^abc] [0-9] [^0-9] (x|y) Metacharacters: . \w \W
\d \D \s \S \b \B \0 \n \f \r \t \v \xxx \xdd \uxxxx Quantifiers: + * ? {X}
{X,Y} {X,} $ ^ ?= ?! Properties: constructor global ignoreCase lastIndex
multiline source Methods: compile() exec() test() toString()
JS Statements
break class const continue debugger do...while for for...in for...of function
if...else let return switch throw try...catch var while
JS String
charAt() charCodeAt() codePointAt() concat() constructor endsWith()
fromCharCode() includes() indexOf() lastIndexOf() length localeCompare() match()
prototype repeat() replace() search() slice() split() startsWith() substr()
substring() toLocaleLowerCase() toLocaleUpperCase() toLowerCase() toString()
toUpperCase() trim() trimEnd() trimStart() valueOf()
JS TypedArray



WINDOW

Window Object
alert() atob() blur() btoa() clearInterval() clearTimeout() close() closed
confirm() console defaultStatus document focus() frameElement frames history
getComputedStyle() innerHeight innerWidth length localStorage location
matchMedia() moveBy() moveTo() name navigator open() opener outerHeight
outerWidth pageXOffset pageYOffset parent print() prompt() resizeBy() resizeTo()
screen screenLeft screenTop screenX screenY scrollBy() scrollTo() scrollX
scrollY sessionStorage self setInterval() setTimeout() status stop() top
Window Console
assert() clear() count() error() group() groupCollapsed() groupEnd() info()
log() table() time() timeEnd() trace() warn()
Window History
back() forward() go() length
Window Location
assign() hash host hostname href origin pathname port protocol reload()
replace() search
Window Navigator
appCodeName appName appVersion cookieEnabled geolocation javaEnabled() language
onLine platform product taintEnabled() userAgent
Window Screen
availHeight availWidth colorDepth height pixelDepth width



HTML DOM

HTML Documents
activeElement addEventListener() adoptNode() anchors applets baseURI body
charset characterSet close() cookie createAttribute() createComment()
createDocumentFragment() createElement() createEvent() createTextNode()
defaultView designMode doctype documentElement documentMode documentURI domain
domConfig embeds execCommand() forms getElementById() getElementsByClassName()
getElementsByName() getElementsByTagName() hasFocus() head images implementation
importNode() inputEncoding lastModified links normalize() normalizeDocument()
open() querySelector() querySelectorAll() readyState referrer
removeEventListener() renameNode() scripts strictErrorChecking title URL write()
writeln()
HTML Elements
accessKey addEventListener() appendChild() attributes blur() childElementCount
childNodes children classList className click() clientHeight clientLeft
clientTop clientWidth cloneNode() closest() compareDocumentPosition() contains()
contentEditable dir firstChild firstElementChild focus() getAttribute()
getAttributeNode() getBoundingClientRect() getElementsByClassName()
getElementsByTagName() hasAttribute() hasAttributes() hasChildNodes() id
innerHTML innerText insertAdjacentElement() insertAdjacentHTML()
insertAdjacentText() insertBefore() isContentEditable isDefaultNamespace()
isEqualNode() isSameNode() isSupported() lang lastChild lastElementChild
matches() namespaceURI nextSibling nextElementSibling nodeName nodeType
nodeValue normalize() offsetHeight offsetWidth offsetLeft offsetParent offsetTop
outerHTML outerText ownerDocument parentNode parentElement previousSibling
previousElementSibling querySelector() querySelectorAll() remove()
removeAttribute() removeAttributeNode() removeChild() removeEventListener()
replaceChild() scrollHeight scrollIntoView() scrollLeft scrollTop scrollWidth
setAttribute() setAttributeNode() style tabIndex tagName textContent title
HTML Attributes
getNamedItem() isId item() length name removeNamedItem() setNamedItem()
specified value
HTML Events
abort afterprint animationend animationiteration animationstart beforeprint
beforeunload blur canplay canplaythrough change click contextmenu copy cut
dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange
ended error focus focusin focusout fullscreenchange fullscreenerror hashchange
input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart
message mousedown mouseenter mouseleave mousemove mouseover mouseout mouseup
offline online open pagehide pageshow paste pause play playing progress
ratechange resize reset scroll search seeked seeking select show stalled submit
suspend timeupdate toggle touchcancel touchend touchmove touchstart
transitionend unload volumechange waiting wheel altKey altKey animationName
bubbles button buttons cancelable charCode clientX clientY code ctrlKey ctrlKey
currentTarget data defaultPrevented deltaX deltaY deltaZ deltaMode detail
elapsedTime elapsedTime eventPhase getModifierState() inputType isTrusted key
keyCode location metaKey metaKey newURL oldURL pageX pageY persisted
preventDefault() propertyName relatedTarget relatedTarget screenX screenY
shiftKey shiftKey stopImmediatePropagation() stopPropagation() target
targetTouches timeStamp touches type which which view
HTML Event Objects
AnimationEvent ClipboardEvent DragEvent Event FocusEvent HashChangeEvent
InputEvent KeyboardEvent MouseEvent PageTransitionEvent PopStateEvent
ProgressEvent StorageEvent TouchEvent TransitionEvent UiEvent WheelEvent
HTML Collection
item() length namedItem()
HTML NodeList
entries() forEach() item() keys() length values()
HTML DOMTokenList
add() contains() entries() forEach() item() keys() length remove() replace()
supports() toggle() value values()
HTML Styles
alignContent alignItems alignSelf animation animationDelay animationDirection
animationDuration animationFillMode animationIterationCount animationName
animationTimingFunction animationPlayState background backgroundAttachment
backgroundColor backgroundImage backgroundPosition backgroundRepeat
backgroundClip backgroundOrigin backgroundSize backfaceVisibility border
borderBottom borderBottomColor borderBottomLeftRadius borderBottomRightRadius
borderBottomStyle borderBottomWidth borderCollapse borderColor borderImage
borderImageOutset borderImageRepeat borderImageSlice borderImageSource
borderImageWidth borderLeft borderLeftColor borderLeftStyle borderLeftWidth
borderRadius borderRight borderRightColor borderRightStyle borderRightWidth
borderSpacing borderStyle borderTop borderTopColor borderTopLeftRadius
borderTopRightRadius borderTopStyle borderTopWidth borderWidth bottom boxShadow
boxSizing captionSide caretColor clear clip color columnCount columnFill
columnGap columnRule columnRuleColor columnRuleStyle columnRuleWidth columns
columnSpan columnWidth counterIncrement counterReset cssFloat cursor direction
display emptyCells filter flex flexBasis flexDirection flexFlow flexGrow
flexShrink flexWrap font fontFamily fontSize fontStyle fontVariant fontWeight
fontSizeAdjust height isolation justifyContent left letterSpacing lineHeight
listStyle listStyleImage listStylePosition listStyleType margin marginBottom
marginLeft marginRight marginTop maxHeight maxWidth minHeight minWidth objectFit
objectPosition opacity order orphans outline outlineColor outlineOffset
outlineStyle outlineWidth overflow overflowX overflowY padding paddingBottom
paddingLeft paddingRight paddingTop pageBreakAfter pageBreakBefore
pageBreakInside perspective perspectiveOrigin position quotes resize right
scrollBehavior tableLayout tabSize textAlign textAlignLast textDecoration
textDecorationColor textDecorationLine textDecorationStyle textIndent
textOverflow textShadow textTransform top transform transformOrigin
transformStyle transition transitionProperty transitionDuration
transitionTimingFunction transitionDelay unicodeBidi userSelect verticalAlign
visibility width wordBreak wordSpacing wordWrap widows zIndex



WEB APIS

API Console API Fetch API Fullscreen
exitFullscreen() fullscreenElement fullscreenEnabled() requestFullscreen()
API Geolocation
coordinates getCurrentPosition() position
API History API MediaQueryList API Storage
clear() getItem() key() length removeItem() setItem()
API Validation API Web
crypto.getRandomNumber()



HTML OBJECTS

<a> <abbr> <address> <area> <article> <aside> <audio> <b> <base> <bdo>
<blockquote> <body> <br> <button> <canvas> <caption> <cite> <code> <col>
<colgroup> <datalist> <dd> <del> <details> <dfn> <dialog> <div> <dl> <dt> <em>
<embed> <fieldset> <figcaption> <figure> <footer> <form> <head> <header> <h1> -
<h6> <hr> <html> <i> <iframe> <img> <ins> <input> button <input> checkbox
<input> color <input> date <input> datetime <input> datetime-local <input> email
<input> file <input> hidden <input> image <input> month <input> number <input>
password <input> radio <input> range <input> reset <input> search <input> submit
<input> text <input> time <input> url <input> week <kbd> <label> <legend> <li>
<link> <map> <mark> <menu> <menuitem> <meta> <meter> <nav> <object> <ol>
<optgroup> <option> <output> <p> <param> <pre> <progress> <q> <s> <samp>
<script> <section> <select> <small> <source> <span> <strong> <style> <sub>
<summary> <sup> <table> <tbody> <td> <tfoot> <th> <thead> <tr> <textarea> <time>
<title> <track> <u> <ul> <var> <video>



OTHER REFERENCES

CSSStyleDeclaration
cssText getPropertyPriority() getPropertyValue() item() length parentRule
removeProperty() setProperty()
JS Conversion





JAVASCRIPT TYPED ARRAY REFERENCE

❮ Previous Next ❯


EXAMPLE

const myArr = new Int8Array(10);
Try it Yourself »


JAVASCRIPT TYPED ARRAYS

In Javascript, a typed array is an array-like buffer of binary data.

There is no JavaScript property or object named TypedArray, but properties and
methods can be used with typed array objects:

--------------------------------------------------------------------------------


TYPED ARRAY OBJECTS

Object Data Type Range Int8Array Signed integer (byte) -128/127 Uint8Array
Unsigned integer (octet) 0/255 Uint8ClampedArray Unsigned integer (octet) 0/255
Int16Array Short integer -32768/32767 Uint16Array Unsigned short integer 0/65535
Int32Array Signed long integer -231/231-1 Uint32Array Unsigned long integer
0/232 Float32Array Float - 7 significant digits 1.2x10-38/3.4x1038 Float64Array
Double - 16 significant digits 5.0x10-324/1.8x10308 BigInt64Array Big signed
integer -263/263-1 BigUint64Array Big unsigned integer 0/264


NOTE

Typed arrays are not arrays.

isArray() on a typed array returns false.

Many array methods (like push and pop) are not supported by typed arrays.

Typed arrays are array-like objects for storing binary data in memory.

--------------------------------------------------------------------------------

ADVERTISEMENT


--------------------------------------------------------------------------------


TYPED ARRAY METHODS AND PROPERTIES

Method / Property Description BYTES_PER_ELEMENT Property to count the number of
bytes used to store one element fill() Fill all elements with a value find()
Returns the first element that satisfies a condition name Returns the name of
the typed array of() Method to create a typed array from an array some() Reurns
true if one element satisfies a condition

--------------------------------------------------------------------------------


UINT8ARRAY VS UINT8CLAMPEDARRAY

The difference between an Uint8Array and an Uint8ClampedArray is how values are
added.

If you set one element in an Uint8ClampedArray to a value outside the 0-255
range, it will default to 0 or 255.

A typed array will just take the first 8 bits of the value.

--------------------------------------------------------------------------------


TYPED ARRAY BENEFITS

Typed arrays provide a way to handle binary data as efficiently as arrays work
in C.

Typed arrays are raw memory, so JavaScript can pass them directly to any
function without converting the data to another representation.

Typed arrays are serously faster than normal arrays, for passing data to
functions that can use raw binary data (Computer Games, WebGL, Canvas, File
APIs, Media APIs).

--------------------------------------------------------------------------------


BROWSER APIS SUPPORTING TYPED ARRAYS


FETCH API EXAMPLE

fetch(url)
.then(request => request.arrayBuffer())
.then(arrayBuffer =>...);



CANVAS EXAMPLE

const canvas = document.getElementById('my_canvas');
const context = canvas.getContext('2d');
const imageData = context.getImageData(0, 0, canvas.width, canvas.height);
const uint8ClampedArray = imageData.data;

--------------------------------------------------------------------------------


BROWSER SUPPORT

typedArray is an ECMAScript6 (ES6) feature.

ES6 (JavaScript 2015) is supported in all modern browsers:

Chrome Edge Firefox Safari Opera Yes Yes Yes Yes Yes

typedArray is not supported in Internet Explorer 11 (or earlier).


❮ Previous Next ❯


ADVERTISEMENT



COLOR PICKER



Get certified
by completing
a JavaScript
course today!

w3schools CERTIFIED . 2022
Get started


ADVERTISEMENT


--------------------------------------------------------------------------------

ADVERTISEMENT

ADVERTISEMENT


--------------------------------------------------------------------------------

Report Error
Report Error
Spaces
Spaces
Upgrade
Upgrade
Newsletter
Newsletter
Get Certified
Get Certified

--------------------------------------------------------------------------------

×


REPORT ERROR

If you want to report an error, or if you want to make a suggestion, do not
hesitate to send us an e-mail:

help@w3schools.com


×


THANK YOU FOR HELPING US!

Your message has been sent to W3Schools.

TOP TUTORIALS

HTML Tutorial
CSS Tutorial
JavaScript Tutorial
How To Tutorial
SQL Tutorial
Python Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
PHP Tutorial
Java Tutorial
C++ Tutorial
jQuery Tutorial


TOP REFERENCES

HTML Reference
CSS Reference
JavaScript Reference
SQL Reference
Python Reference
W3.CSS Reference
Bootstrap Reference
PHP Reference
HTML Colors
Java Reference
Angular Reference
jQuery Reference


TOP EXAMPLES

HTML Examples
CSS Examples
JavaScript Examples
How To Examples
SQL Examples
Python Examples
W3.CSS Examples
Bootstrap Examples
PHP Examples
Java Examples
XML Examples
jQuery Examples


GET CERTIFIED

HTML Certificate
CSS Certificate
JavaScript Certificate
Front End Certificate
SQL Certificate
Python Certificate
PHP Certificate
jQuery Certificate
Java Certificate
C++ Certificate
C# Certificate
XML Certificate


--------------------------------------------------------------------------------

FORUM | ABOUT
W3Schools is optimized for learning and training. Examples might be simplified
to improve reading and learning. Tutorials, references, and examples are
constantly reviewed to avoid errors, but we cannot warrant full correctness of
all content. While using W3Schools, you agree to have read and accepted our
terms of use, cookie and privacy policy.

Copyright 1999-2022 by Refsnes Data. All Rights Reserved.
W3Schools is Powered by W3.CSS.