pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/values

ref="https://developer.mozilla.org/favicon.ico" />

Cette page a été traduite à partir de l'anglais par la communauté. Vous pouvez contribuer en rejoignant la communauté francophone sur MDN Web Docs.

View in English Always switch to English

TypedArray.prototype.values()

Baseline Widely available

Cette fonctionnalité est bien établie et fonctionne sur de nombreux appareils et versions de navigateurs. Elle est disponible sur tous les navigateurs depuis septembre 2016.

La méthode values() renvoie un nouvel objet Array Iterator qui contient les valeurs pour chaque indice du tableau.

Exemple interactif

const uint8 = new Uint8Array([10, 20, 30, 40, 50]);
const array1 = uint8.values();

array1.next();
array1.next();

console.log(array1.next().value);
// Expected output: 30

Syntaxe

js
typedArr.values();

Valeur de retour

Un nouvel objet Array Iterator.

Exemples

Parcourir le tableau typé avec for...of

js
var arr = new Uint8Array([10, 20, 30, 40, 50]);
var eArray = arr.values();
// prérequis : le navigateur doit supporter les boucles
// for..of et les variables dont la portée est définie
// par let
for (let n of eArray) {
  console.log(n);
}

Une autre méthode d'itération

js
var arr = new Uint8Array([10, 20, 30, 40, 50]);
var eArr = arr.values();
console.log(eArr.next().value); // 10
console.log(eArr.next().value); // 20
console.log(eArr.next().value); // 30
console.log(eArr.next().value); // 40
console.log(eArr.next().value); // 50

Spécifications

Specification
ECMAScript® 2026 Language Specification
# sec-%typedarray%.prototype.values

Compatibilité des navigateurs

Voir aussi

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy