DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
Foundations & Tooling Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
medium
Foundations & Tooling
What is the difference between `.match(/pattern/)` and `.match(/pattern/g)`?
A
No difference — both return all matches
B
`/g` returns all matches as a flat array; without `/g` returns the first match as a rich object with groups and index
C
`/g` is case-insensitive; without `/g` is case-sensitive
D
`/g` searches globally across multiple strings; without `/g` searches the current string only
Check Answer