← Back to release summary

Boolean return value of DOMTokenList replace()

Category
DOM
Type
New or changed feature
Status
Enabled by default (Chrome 67)
Intent stage
None

Summary

The DOM specification was updated so that DOMTokenList replace() returns a boolean value. This is useful for code which takes different paths depending on whether a replacement occurred, avoiding the need for an extra condition using contains().

Standards & signals

View on chromestatus.com