Free Salesforce JavaScript Developer Practice Test Questions

Topic: Variables, Types, and Collections

147 questions Updated 23-Nov-2026 7 topics
TopicVariables, Types, and Collections
Question 1 Choose 1
Value of:

true + 3 + ' 100 ' + null
Question 2 Choose 2
Given two expressions var1 and var2, what are two valid ways to return the concatenation of the two expressions and ensure it is data type string?
Question 3 Choose 2
const str = ' Salesforce ' ;

Which two statements result in the word " Sales " ?
Question 4 Choose 1
function myFunction() {

a = a + b;

var b = 1;

}

myFunction();

console.log(a);

console.log(b);

Which statement is correct?
Question 5 Choose 2
Refer to the code below:

let inArray = [ [1, 2], [3, 4, 5] ];

Which two statements result in the array [1, 2, 3, 4, 5]?

(With corrected typing errors: usArray # inArray, .. # ....)
Question 6 Choose 3
Given a value, which three options can a developer use to detect if the value is NaN?
Question 7
Refer to the code below:

const searchText = ' Yay! Salesforce is amazing! ' ;

let result1 = searchText.search(/sales/i);

let result2 = searchText.search(/sales/);

console.log(result1);

console.log(result2);

After running this code, which result is displayed on the console?
Question 8 Choose 3
let sampleText = " The quick brown fox jumps " ;

Which three expressions return true for a substring?

That's the last free question in Variables, Types, and Collections

You've seen the free 25% of this topic (8 of 35 questions). Get complete access for every question, explanation and the timed exam simulator.

Unlock all questions

Experience the real exam before you take it

Our timed 2026 Salesforce JavaScript Developer practice test mirrors the format, number of questions and time limit of the official exam.

The #1 challenge isn't just knowing the material, it's managing the clock. The simulation builds your speed and stamina, so you walk in knowing exactly what to expect.

Take Salesforce JavaScript Developer practice exam
  • Build exam stamina: stay focused and accurate for the entire duration.
  • Master time management: learn to pace yourself so you never have to rush.
  • A new test every time: a randomised set from the Salesforce JavaScript Developer - JS-Dev-101 question pool on every attempt.
  • Unlimited attempts: practice until you're 100% confident, not just once.