Questions et réponses d'entretien les plus demandées et tests en ligne
Plateforme d'apprentissage pour la preparation aux entretiens, les tests en ligne, les tutoriels et la pratique en direct

Developpez vos competences grace a des parcours cibles, des tests blancs et un contenu pret pour l'entretien.

WithoutBook rassemble des questions d'entretien par sujet, des tests pratiques en ligne, des tutoriels et des guides de comparaison dans un espace d'apprentissage reactif.

Preparation a l'entretien

JavaScript Questions et reponses d'entretien

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

Differences associees

Question 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)

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 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

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 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!”

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 29. What are primitives in Javascript?

Boolean, string and number.

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 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).

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Les plus utiles selon les utilisateurs :

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