Salesforce JavaScript Developer Practice Exam

Session length

1 / 20

What is the result of using regex /[A-Z]/ with the g flag on the phrase 'The quick brown fox jumps over the lazy dog. It barked.'?

["T"]

["T", "I"]

The result of using the regex /[A-Z]/ with the g flag on the phrase 'The quick brown fox jumps over the lazy dog. It barked.' accurately returns an array consisting of all uppercase letters found in the string. The regular expression is designed to find any single uppercase letter from A to Z.

In the provided phrase, the letter 'T' from "The" and 'I' from "It" are the only uppercase letters present. The g flag signifies that the search should be global, meaning it will continue to search through the entire string for all matches, not stopping at the first match. Therefore, the regex finds both 'T' and 'I' and collects them into an array.

The result is hence an array containing these two characters: ["T", "I"]. This captures all instances of uppercase letters throughout the entire string, which confirms that choice B is the correct answer.

Error

undefined

Next question

Find the option that is right for you!

All options are one-time payments.

$25.99

30 day premium pass

All the basics to get you started

  • Ad-free experience
  • View your previous attempt history
  • Mobile app access
  • In-depth explanations
  • 30 day premium pass access
👑$59.99 $171.99 usd

6 month DELUXE pass (most popular)

Everything with the 30 day premium pass FOR 6 MONTHS! & the ultimate digital PDF study guide (BONUS)

  • Everything included in the premium pass
  • $171.99 usd value for $59.99! You save $106!
  • + Access to the ultimate digital PDF study guide
  • + 6 months of premium pass access
  • + Priority support
$15.99 $24.99

Ultimate digital PDF study guide

For those that prefer a more traditional form of learning

  • Available for instant download
  • Available offline
  • Hundreds of practice multiple choice questions
  • Comprehensive content
  • Detailed explanations
Image Description
Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy