Scratch for Discord
Web-ApplicationDiscord Server
  • 🏠Home
  • 👋Introduction
    • About Scratch for Discord
  • 🎓Tutorial
    • Block Usage
    • Bot Setup
    • Hosting
    • Slash Commands
  • 🧰Toolbox
    • 💼Base
    • ⚽Basic
      • Text
      • Math
      • Colors
    • 🔩Functions
      • Logic
        • If logic
        • State Machines
      • Loops
      • Lists
      • Variables
        • Var
        • Let and Const
      • Functions
      • Collections
      • Buffers
      • Objects
      • 💾Database
      • 📂Files
        • 🖼️Images
          • 📬Member Cards
      • 🔑Securing
    • 🖥️Discord
      • 🎨Embeds
      • 📻Interactions
        • ⚒️Slash
          • 📤Actions
            • 🧱Stacks
            • 🔎Reporters
          • 📥Events
        • Button
        • Menu
        • Context menu
        • Forms
      • 🥁Music
        • 📜Music Lyrics
      • 🗄️Servers
        • 😀Emojis & Stickers
          • 📤Actions
          • 📤Events
        • 🔰Roles
          • 📤Actions
            • 🧱Stacks
            • ❔Booleans
          • 📤Events
        • 🗓️Schedule events
          • 📤Actions
          • 📤Events
        • 📺Channels
          • 📤Actions
          • 📥Events
        • 💬Messages
          • 📤Actions
            • 📝Messages
            • 📢Threads
            • 🔗Webhooks
            • 🥳Reactions
          • 📥Events
          • 🔎Reporters
            • 📌Message Context
        • 👥Members
          • 📤Actions
          • 📥Events
            • 📭Leave
    • 🚀Applications
      • 📊Charts
    • 🌐Websites
      • Dashboard
  • 🖥️Interface
    • ⚙️Settings
    • ⌨️Hotkeys
    • ▶️Download & Run
    • 🖇️Git
  • 🪄Advanced
    • Custom Code
  • 🔗Links
    • 📦Packages
    • ❔FAQ
    • Web-Application
    • Discord Server
    • Source Code
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub

Last updated 2 years ago

Was this helpful?

Let is a variable type that cannot be redeclared multiple times, any other declaration will result a syntax.

When should you use Let?

You should use let when you know that the value you are setting should not change, If the Variable you want is strictly going to be for one specific value, then Let or Const is the variable type you should use since you do not want to redeclare them.

Diference between Let and Const

Constant can be declared only one time and not be changed, for example server ID.

Let will last for each event, for example Interaction author.

For example I have set my name to John, since I want John to be the fixed value that cannot be changed.

  1. 🧰Toolbox
  2. 🔩Functions
  3. Variables

Let and Const

PreviousVarNextFunctions
  • When should you use Let?
  • Diference between Let and Const
Example of Let usage