A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/of below:

TypedArray.of() - JavaScript | MDN

TypedArray.of()

Baseline Widely available

La méthode TypedArray.of() crée un nouvel objet TypedArray à partir d'un nombre variable d'arguments. Cette méthode est similaire à Array.of().

Syntaxe Paramètres
élémentN

Les éléments avec lesquels on souhaite construire le nouveau tableau typé.

Valeur de retour

Une nouvelle instance de TypedArray.

Description

Il existe de légères différences entre Array.of() et TypedArray.of() :

Exemples
Uint8Array.of(1); // Uint8Array [ 1 ]
Int8Array.of("1", "2", "3"); // Int8Array [ 1, 2, 3 ]
Float32Array.of(1, 2, 3); // Float32Array [ 1, 2, 3 ]
Int16Array.of(undefined); // Int16Array [ 0 ]
Spécifications Compatibilité des navigateurs Voir aussi

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4