Syntax Error - MDN Web Docs Glossary: Definitions Of Web-related ...

  • Skip to main content
  • Skip to search
Syntax error

An exception caused by the incorrect use of a pre-defined syntax. Syntax errors are detected while compiling or parsing source code.

For example, if you leave off a closing brace (}) when defining a JavaScript function, you trigger a syntax error. Browser development tools display JavaScript and CSS syntax errors in the console.

In this article

  • See also

See also

  • Syntax error on Wikipedia
  • SyntaxError JavaScript object

Help improve MDN

Was this page helpful to you? Yes No Learn how to contribute

This page was last modified on Jul 11, 2025 by MDN contributors.

View this page on GitHub • Report a problem with this content Filter sidebar
  1. Glossary
    1. Abstraction
    2. Accent
    3. Accessibility
    4. Accessibility tree
    5. Accessible description
    6. Accessible name
    7. Adobe Flash
    8. Advance measure
    9. Ajax
    10. Algorithm
    11. Alignment container
    12. Alignment subject
    13. Alpha (alpha channel)
    14. ALPN
    15. API
    16. Apple Safari
    17. Application context
    18. Argument
    19. ARIA
    20. ARPA
    21. ARPANET
    22. Array
    23. ASCII
    24. Aspect ratio
    25. Asynchronous
    26. ATAG
    27. Attribute
    28. Authentication
    29. Authenticator
    30. Bandwidth
    31. Base64
    32. Baseline
      1. Baseline (compatibility)
      2. Baseline (typography)
    33. BCP 47 language tag
    34. Beacon
    35. Bézier curve
    36. bfcache
    37. BiDi
    38. BigInt
    39. Binding
    40. Bitwise flags
    41. Blink
    42. blink element (<blink> tag)
    43. Block
      1. Block (CSS)
      2. Block (scripting)
    44. Block cipher mode of operation
    45. Block-level content
    46. Boolean
      1. Boolean (JavaScript)
      2. Boolean attribute (ARIA)
      3. Boolean attribute (HTML)
    47. Bounding box
    48. Breadcrumb
    49. Brotli compression
    50. Browser
    51. Browsing context
    52. Buffer
    53. Bun
    54. Cache
    55. Cacheable
    56. CalDAV
    57. Call stack
    58. Callback function
    59. Camel case
    60. Canonical order
    61. Canvas
    62. Card sorting
    63. CardDAV
    64. Caret
    65. CDN
    66. Certificate authority
    67. Certified
    68. Challenge-response authentication
    69. Character
    70. Character encoding
    71. Character reference
    72. Character set
    73. Chrome
    74. CIA
    75. Cipher
    76. Cipher suite
    77. Ciphertext
    78. Class
    79. Client-side rendering (CSR)
    80. Closure
    81. Cloud
    82. Cloud computing
    83. CMS
    84. Code point
    85. Code splitting
    86. Code unit
    87. Codec
    88. Color space
    89. Color wheel
    90. Compile
    91. Compile time
    92. Composite operation
    93. Compression Dictionary Transport
    94. Computer programming
    95. Conditional
    96. Constant
    97. Constructor
    98. Content header
    99. Continuous integration
    100. Continuous media
    101. Control flow
    102. Cookie
    103. Copyleft
    104. CORS
    105. CORS-safelisted request header
    106. CORS-safelisted response header
    107. Crawler
    108. Credential
    109. CRLF
    110. Cross Axis
    111. Cross-site request forgery (CSRF)
    112. Cross-site scripting (XSS)
    113. CRUD
    114. Cryptanalysis
    115. Cryptography
    116. CSP
    117. CSS
    118. CSS Object Model (CSSOM)
    119. CSS pixel
    120. CSS preprocessor
    121. Cumulative Layout Shift (CLS)
    122. Data structure
    123. Database
    124. Debounce
    125. Decryption
    126. Deep copy
    127. Delta
    128. Denial of Service (DoS)
    129. Deno
    130. Descriptor (CSS)
    131. Deserialization
    132. Developer tools
    133. Device pixel
    134. Digital certificate
    135. Digital signature
    136. Distributed Denial of Service (DDoS)
    137. DMZ
    138. DNS
    139. Doctype
    140. Document directive
    141. Document environment
    142. DOM (Document Object Model)
    143. Domain
    144. Domain name
    145. Domain sharding
    146. Dominator
    147. DSL
      1. DSL (Digital Subscriber Line)
      2. DSL (Domain-Specific Language)
    148. DTLS (Datagram Transport Layer Security)
    149. DTMF (Dual-Tone Multi-Frequency signaling)
    150. Dynamic typing
    151. ECMA
    152. ECMAScript
    153. Effective connection type
    154. Element
    155. Encapsulation
    156. Encryption
    157. Endianness
    158. Engine
      1. JavaScript engine
      2. Rendering engine
    159. Entity
    160. Entity header
    161. Enumerated
    162. Escape character
    163. Event
    164. Exception
    165. EXIF
    166. Expando
    167. Extrinsic size
    168. Fallback alignment
    169. Falsy
    170. Favicon
    171. Federated identity
    172. Fetch directive
    173. Fetch metadata request header
    174. Fingerprinting
    175. Firefox OS
    176. Firewall
    177. First Contentful Paint (FCP)
    178. First CPU idle
    179. First Input Delay (FID) Deprecated
    180. First Meaningful Paint (FMP)
    181. First Paint (FP)
    182. First-class function
    183. Flex
    184. Flex container
    185. Flex item
    186. Flexbox
    187. Flow relative values
    188. Forbidden request header
    189. Forbidden response header name
    190. Fork
    191. Fragmentainer
    192. Frame rate (FPS)
    193. FTP
    194. FTU
    195. Function
    196. Fuzz testing
    197. Gamut
    198. Garbage collection
    199. Gecko
    200. General header
    201. GIF
    202. Git
    203. Global object
    204. Global scope
    205. Global variable
    206. Glyph
    207. Google Chrome
    208. GPL
    209. GPU
    210. Graceful degradation
    211. Grid
    212. Grid areas
    213. Grid Axis
    214. Grid Cell
    215. Grid Column
    216. Grid container
    217. Grid lines
    218. Grid Row
    219. Grid Tracks
    220. Guaranteed-invalid value
    221. Gutters
    222. gzip compression
    223. Hash function
    224. Hash routing
    225. Head
    226. High-level programming language
    227. HMAC
    228. Hoisting
    229. HOL blocking
    230. Host
    231. Hotlink
    232. Houdini
    233. HPKP
    234. HSTS
    235. HTML
    236. HTML color codes
    237. HTML5
    238. HTTP
    239. HTTP content
    240. HTTP header
    241. HTTP/2
    242. HTTP/3
    243. HTTPS
    244. HTTPS RR
    245. Hyperlink
    246. Hypertext
    247. IANA
    248. ICANN
    249. ICE
    250. IDE
    251. Idempotent
    252. Identifier
    253. Identity provider (IdP)
    254. IDL
    255. IETF
    256. IIFE
    257. IMAP
    258. Immutable
    259. IndexedDB
    260. Information architecture
    261. Inheritance
    262. Ink overflow
    263. Inline-level content
    264. Input method editor
    265. Inset properties
    266. Instance
    267. Interaction to Next Paint (INP)
    268. Internationalization (i18n)
    269. Internet
    270. Interpolation
    271. Intrinsic size
    272. Invariant
    273. IP Address
    274. IPv4
    275. IPv6
    276. IRC
    277. ISO
    278. ISP
    279. ITU
    280. Jank
    281. Java
    282. JavaScript
    283. Jitter
    284. JPEG
    285. JSON
    286. JSON type representation
    287. Just-In-Time Compilation (JIT)
    288. Kebab case
    289. Key
    290. Keyword
    291. Largest Contentful Paint (LCP)
    292. Latency
    293. Layout mode
    294. Layout viewport
    295. Lazy load
    296. Leading
    297. LGPL
    298. Ligature
    299. Literal
    300. Local scope
    301. Local variable
    302. Locale
    303. Localization
    304. Logical properties
    305. Long task
    306. Loop
    307. Lossless compression
    308. Lossy compression
    309. LTR (Left To Right)
    310. Main axis
    311. Main thread
    312. Markup
    313. MathML
    314. Media
      1. Media (Audio-visual presentation)
      2. Media (CSS)
    315. Media query
    316. Metadata
    317. Method
    318. Microsoft Edge
    319. Microsoft Internet Explorer
    320. Middleware
    321. MIME
    322. MIME type
    323. Minification
    324. MitM
    325. Mixin
    326. Mobile first
    327. Modem
    328. Modularity
    329. Mozilla Firefox
    330. Multi-factor authentication
    331. Mutable
    332. MVC
    333. Namespace
    334. NaN
    335. NAT
    336. Native
    337. Navigation directive
    338. Netscape Navigator
    339. Network throttling
    340. NNTP
    341. Node
      1. Node (DOM)
      2. Node (networking)
    342. Node.js
    343. Non-normative
    344. Nonce
    345. Normative
    346. Null
    347. Nullish value
    348. Number
    349. Object
    350. Object reference
    351. OOP
    352. OpenGL
    353. OpenSSL
    354. Opera browser
    355. Operand
    356. Operator
    357. Origin
    358. OTA
    359. OWASP
    360. P2P
    361. PAC
    362. Packet
    363. Page load time
    364. Page prediction
    365. Parameter
    366. Parent object
    367. Parse
    368. Parser
    369. Payload body
    370. Payload header
    371. PDF
    372. Perceived performance
    373. Percent-encoding
    374. PHP
    375. Physical properties
    376. Pixel
    377. Placeholder names
    378. Plaintext
    379. Plugin
    380. PNG
    381. Polyfill
    382. Polymorphism
    383. POP3
    384. Port
    385. Prefetch
    386. Preflight request
    387. Prerender
    388. Presto
    389. Primitive
    390. Principle of least privilege
    391. Privileged
    392. Privileged code
    393. Progressive enhancement
    394. Progressive web applications (PWAs)
    395. Promise
    396. Property
      1. Property (CSS)
      2. Property (JavaScript)
    397. Protocol
    398. Prototype
    399. Prototype-based programming
    400. Proxy server
    401. Pseudo-class
    402. Pseudo-element
    403. Pseudocode
    404. Public-key cryptography
    405. Python
    406. Quality values
    407. Quaternion
    408. QUIC
    409. RAIL
    410. Random Number Generator
    411. Raster image
    412. Rate limit
    413. RDF
    414. Reading order
    415. Real User Monitoring (RUM)
    416. Recursion
    417. Reflow
    418. Registrable domain
    419. Regular expression
    420. Relying party
    421. Render-blocking
    422. Repaint
    423. Replaced elements
    424. Replay attack
    425. Repo
    426. Reporting directive
    427. Representation header
    428. Request header
    429. Resource Timing
    430. Response header
    431. Responsive Web Design (RWD)
    432. REST
    433. RGB
    434. RIL
    435. Robots.txt
    436. Round Trip Time (RTT)
    437. Router
    438. RSS
    439. Rsync
    440. RTCP (RTP Control Protocol)
    441. RTF
    442. RTL (Right to Left)
    443. RTP (Real-time Transport Protocol) and SRTP (Secure RTP)
    444. RTSP: Real-time streaming protocol
    445. Ruby
    446. Safe
      1. Safe (HTTP Methods)
    447. Salt
    448. Same-origin policy
    449. SCM
    450. Scope
    451. Screen reader
    452. Script-supporting element
    453. Scroll boundary
    454. Scroll chaining
    455. Scroll container
    456. Scroll snap
    457. SCTP
    458. SDK (Software Development Kit)
    459. SDP
    460. Search engine
    461. Secure context
    462. Secure Sockets Layer (SSL)
    463. Selector (CSS)
    464. Semantics
    465. SEO
    466. Serializable object
    467. Serialization
    468. Server
    469. Server Timing
    470. Server-side rendering (SSR)
    471. Session hijacking
    472. SGML
    473. Shadow tree
    474. Shallow copy
    475. Shim
    476. Signature
      1. Signature (functions)
      2. Signature (security)
    477. SIMD
    478. SISD
    479. Site
    480. Site map
    481. SLD
    482. Sloppy mode
    483. Slug
    484. Smoke test
    485. SMPTE (Society of Motion Picture and Television Engineers)
    486. SMTP
    487. Snake case
    488. Snap positions
    489. SOAP
    490. Social engineering
    491. Source map
    492. SPA (Single-page application)
    493. Specification
    494. Speculative parsing
    495. Speed index
    496. SQL
    497. SQL injection
    498. SRI
    499. Stacking context
    500. State machine
    501. Statement
    502. Static method
    503. Static site generator (SSG)
    504. Static typing
    505. Sticky activation
    506. Strict mode
    507. String
    508. Stringifier
    509. STUN
    510. Style origin
    511. Stylesheet
    512. Submit button
    513. SVG
    514. SVN
    515. Symbol
    516. Symmetric-key cryptography
    517. Synchronous
    518. Syntax
    519. Syntax error
    520. Synthetic monitoring
    521. Table grid box
    522. Table wrapper box
    523. Tag
    524. TCP
    525. TCP handshake
    526. TCP slow start
    527. Telnet
    528. Texel
    529. The Khronos Group
    530. Thread
    531. Three js
    532. Throttle
    533. Time to First Byte (TTFB)
    534. Time to Interactive (TTI)
    535. TLD
    536. TOFU
    537. Top layer
    538. Transient activation
    539. Transport Layer Security (TLS)
    540. Tree shaking
    541. Trident
    542. Truthy
    543. TTL
    544. TURN
    545. Type
    546. Type coercion
    547. Type conversion
    548. TypeScript
    549. UAAG
    550. UDP (User Datagram Protocol)
    551. UI
    552. Undefined
    553. Unicode
    554. Unix time
    555. URI
    556. URL
    557. URN
    558. Usenet
    559. User agent
    560. UTF-8
    561. UTF-16
    562. UUID
    563. UX
    564. Validator
    565. Value
    566. Variable
    567. Vendor prefix
    568. Viewport
    569. Visual viewport
    570. Void element
    571. VoIP
    572. W3C
    573. WAI
    574. WCAG
    575. Web performance
    576. Web server
    577. Web standards
    578. WebAssembly
    579. WebDAV
    580. WebExtensions
    581. WebGL
    582. WebIDL
    583. WebKit
    584. WebM
    585. WebP
    586. WebRTC
    587. WebSockets
    588. WebVTT
    589. WHATWG
    590. Whitespace
    591. WindowProxy
    592. World Wide Web
    593. Wrapper
    594. XForms Deprecated
    595. XHTML
    596. XInclude
    597. XLink
    598. XML
    599. XMLHttpRequest (XHR)
    600. XPath
    601. XQuery
    602. XSLT
    603. Zstandard compression

Tag » What Is A Syntax Error