Principais perguntas e respostas de entrevista e testes online
Plataforma educacional para preparacao de entrevistas, testes online, tutoriais e pratica ao vivo

Desenvolva habilidades com trilhas de aprendizado focadas, simulados e conteudo pronto para entrevistas.

WithoutBook reune perguntas de entrevista por assunto, testes praticos online, tutoriais e guias comparativos em um unico espaco de aprendizado responsivo.

Preparar entrevista

JavaScript perguntas e respostas de entrevista

Test your skills through the online practice test: JavaScript Quiz Online Practice Test

Diferencas relacionadas

Pergunta 26. Explain String functions in Javascript.

a class defines a new type (formally, Abstract Data Type)
encapsulates data (properties) and operations on that data (methods)

a String encapsulates a sequence of characters, enclosed in quotes

properties include
length : stores the number of characters in the string

methods include
charAt(index) : returns the character stored at the given index
(as in C++/Java, indices start at 0)
substring(start, end) : returns the part of the string between the start
(inclusive) and end (exclusive) indices
toUpperCase() : returns copy of string with letters uppercase
toLowerCase() : returns copy of string with letters lowercase


to create a string, assign using new or just make a direct assignment (new is implicit)

word = new String("foo"); word = "foo";

properties/methods are called exactly as in C++/Java

word.length word.charAt(0)

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 27. Tell us about local variables.

If needed, you can declare local variables within a function.

local variable is visible only within the function body after it’s declared.

Commonly used to store results of an intermediate calculation.

function findMaxValue(num1, num2,num3) {
var tempMax; //local var

if (num1 >= num2) {
tempMax = num1;
}

else {
tempMax = num2;
}

if(num3 >= tempMax) {
tempMax = num3;
}

return tempMax;

} //end function

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 28. Explain Global Variables in Javascript.

Global variables are those declared outside of functions
Global variables are ā€˜visible’ from anywhere in the program, including inside functions

var globalHello = ā€œHello!ā€;

function writeHello() {
document.write(globalHello);
}
// outputs ā€œHello!ā€

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 29. What are primitives in Javascript?

Boolean, string and number.

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 30. How do you submit a form using Javascript?

Use document.forms[0].submit();
(0 refers to the index of the form – if you have more than one form in a page, then the first one has the index 0, second has index 1 and so on).

Isto e util? Adicionar comentario Ver comentarios
 

Mais uteis segundo os usuarios:

Copyright Ā© 2026, WithoutBook.
JavaScript vs JqueryJavaScript vs VBScriptJavaScript vs TypeScript