Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Symbols 2/3 | Data Types and Variables
Introduction to JavaScript (staging)

bookSymbols 2/3

Symbol() Function Description:

We can provide a description to the Symbol() function as an optional argument. This description will make our symbols more clear.

The following example creates two symbols: firstName and lastName with values Michael and Clarke respectively:

1234
let firstName = Symbol('Michael'); console.log(firstName.toString()); let lastName = Symbol('Clarke'); console.log(lastName.toString());
copy
Tarefa

Swipe to start coding

Create a symbol with the value key and store it in the variable password. Output the result.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 28
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain what the output of this code will be?

What is the purpose of using Symbol in JavaScript?

Can you show how to use these symbols as object keys?

close

bookSymbols 2/3

Deslize para mostrar o menu

Symbol() Function Description:

We can provide a description to the Symbol() function as an optional argument. This description will make our symbols more clear.

The following example creates two symbols: firstName and lastName with values Michael and Clarke respectively:

1234
let firstName = Symbol('Michael'); console.log(firstName.toString()); let lastName = Symbol('Clarke'); console.log(lastName.toString());
copy
Tarefa

Swipe to start coding

Create a symbol with the value key and store it in the variable password. Output the result.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 28
single

single

some-alt