JavaScript275 Documents

No Numbers In Method Names

Do not put numbers in function or method names, including callable object properties. Use a descriptive name instead of a numbered suffix.

Correct

const getCategories = () => []
class Catalog { getCategories() { return [] } }
const http2Status = 'ready'

Incorrect

const getCategories2 = () => []
class Catalog { getCategories2() { return [] } }
const catalog = { getCategories2: () => [] }

Fix

Rename the function or method to describe its purpose without a number, and update its references.