Created
March 8, 2021 04:15
-
-
Save dsasse07/aff89b1fe5aa6aaa62a5d949af44890f to your computer and use it in GitHub Desktop.
Calling Object keys using variables in JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const greetings = { | |
english: "hello", | |
spanish: "hola" | |
} | |
const langChoice = "spanish" | |
greetings.english //=> "hello" | |
greetings[langChoice] //=> "hola" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment