Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/webassembly/reference/variables/local_set/index.md
6520 views
---
title: Local set slug: WebAssembly/Reference/Variables/Local_set
---

{{WebAssemblySidebar}}

The local.set instruction sets the values of a local variable.

{{EmbedInteractiveExample("pages/wat/local.html", "tabbed-taller")}}

Syntax

;; load the number 2 onto the stack i32.const 2 ;; store the number 2 in the variable $val local.set $val
InstructionBinary opcode
local.set0x21