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

Q207. What is the purpose of uneval - deprecated #213

Closed
d9k opened this issue Sep 12, 2023 · 1 comment
Closed

Q207. What is the purpose of uneval - deprecated #213

d9k opened this issue Sep 12, 2023 · 1 comment

Comments

@d9k
Copy link

d9k commented Sep 12, 2023

Uneval is deprecated and removed from modern browsers:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features#acquiring_source_text

One should use fn.toString() for functions and JSON.stringify() for data.

> function sum(a, b) { return a + b; }
> sum.toString()
'function sum(a, b) { return a + b; }'
@sudheerj
Copy link
Owner

Thanks @d9k for pointing out. The answer has been updated.

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

2 participants