Language concepts

Object branding and display tags

Try the free JavaScript compiler

A display tag can be changed through Symbol.toStringTag. Use appropriate built-in brand checks rather than trusting this text as evidence of internal type.

Formal Syntax & Structure

javascript syntaxjavascript
Object.prototype.toString.call(value)

Working Example

Example Snippetjavascript
const x={[Symbol.toStringTag]:"Array"};console.log(Array.isArray(x));
JavaScript Reference