1. WebAssembly
  2. Reference
  3. WebAssembly Steuerflussanweisungen
  4. drop

Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten. Erfahre mehr über dieses Experiment.

View in English Always switch to English

drop: Wasm Textanweisung

Die drop-Anweisung entfernt einen Wert vom Stapel und verwirft ihn.

Probieren Sie es aus

(module
 (import "console" "log" (func $log (param i32)))
 (func $main
 ;; load two values onto the stack
 i32.const 10
 i32.const 20
 ;; drop the top item from the stack (`20`)
 drop
 call $log ;; log the top value on the stack (`10`)
 )
 (start $main)
)
const url = "{%wasm-url%}";
await WebAssembly.instantiateStreaming(fetch(url), { console });

Syntax

wat
;; push multiple values onto the stack
i32.const 1
i32.const 2
i32.const 3
;; drop the top item from the stack (`3`)
drop
;; the top item on the stack will now be `2`
Anweisung Binärer Opcode
drop 0x1a

Help improve MDN

Erfahren Sie, wie Sie beitragen können Diese Seite wurde automatisch aus dem Englischen übersetzt.

AltStyle によって変換されたページ (->オリジナル) /