Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type safe for Reflect.deleteProperty(object, string|number|symbol) #186

Open
zanminkian opened this issue Feb 5, 2024 · 1 comment
Open

Comments

@zanminkian
Copy link

Reflect.deleteProperty is equivalent to delete operator. Reflect.deleteProperty is modern, but not type safe enough.

@zanminkian
Copy link
Author

Example

const obj = {
  a: 123
}

delete obj.b // type error
Reflect.deleteProperty(obj, 'b') // pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant