Flashcards
Easy
Flashcards do conjunto (16)
- 1QuestionAnswer
- 2What does 'var' do in JavaScript?'var' declares a variable, which can be globally or function-scoped.
- 3How do you create an array in JavaScript?Using square brackets: const arr = [1, 2, 3];
- 4What is 'let' used for?'let' declares a block-scoped variable.
- 5What does 'const' do?'const' declares a constant, block-scoped variable that cannot be reassigned.
- 6How to check if a variable is an array?Using Array.isArray(variable);
- 7What does 'map()' do?Creates a new array with the results of calling a function for every element.
- 8How do you write an arrow function?const func = () => {};
- 9What is 'this' keyword in JavaScript?'this' refers to the context in which a function is called.
- 10How do you add an element to the end of an array?Using arr.push(element);
- 11How do you remove the first element of an array?Using arr.shift();
- 12What does 'typeof' operator do?Returns the type of a variable as a string.
- 13What is the difference between '==' and '==='?'==' compares values, while '===' compares both values and types.
- 14How do you convert a string to a number?Using Number(str) or parseInt(str).
- 15How do you find the length of an array?Using arr.length.
- 16What does 'forEach()' do?Executes a function once for each array element.
Informações
- Descrição
- Beginner JavaScript FlashCards sobre Easy, criado por Kenneth Crabtree em 09-11-2024.
- Criado por
- Kenneth Crabtree
- Visualizações
- 1
- Avaliação