Suggestion
π Search Terms
string prototype object number stringprototype
β
Viability Checklist
My suggestion meets these guidelines:
β Suggestion
We're always seeing people writing String, Number, Object, and so on, in places where they should be writing their primitive equivalents.
We should mark these as @deprecated so that they show up with strikethroughs in the editor, and make new global interfaces named e.g. StringPrototype so it's more clear what they're for.
/**
* @deprecated Use `string` when working with strings, or use `StringPrototype` to declare new string methods
*/
interface String {
For back compat, possibly forever, we'll need to declare these as
interface StringPrototype extends String { }
so that existing references to String["charAt"] continue to work and so that other merges continue to function.
π Motivating Example


π» Use Cases
Suggestion
π Search Terms
string prototype object number stringprototype
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
We're always seeing people writing
String,Number,Object, and so on, in places where they should be writing their primitive equivalents.We should mark these as
@deprecatedso that they show up with strikethroughs in the editor, and make new global interfaces named e.g.StringPrototypeso it's more clear what they're for.For back compat, possibly forever, we'll need to declare these as
so that existing references to
String["charAt"]continue to work and so that other merges continue to function.π Motivating Example
π» Use Cases