We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
const
let
❌ Hey, What's the matter?
function calculate() { let arrayOrString = somethingFunc(); let isArray = Array.isArray(arrayOrString) if (isArray) { console.log(typeof arrayOrString) // string | object (array) 💥 // isn't array? } }
Come back to const!
- let arrayOrString = somethingFunc(); + const arrayOrString = somethingFunc(); - let isArray = Array.isArray(arrayOrString) + const isArray = Array.isArray(arrayOrString)
so,
✅ That's right
function calculate() { const arrayOrString = somethingFunc(); const isArray = Array.isArray(arrayOrString) if (isArray) { - console.log(typeof arrayOrString) // string | object (array) + console.log(typeof arrayOrString) // object (array) 🥰 } }
The text was updated successfully, but these errors were encountered:
어찌 이런 일이..
Sorry, something went wrong.
No branches or pull requests
❌ Hey, What's the matter?
Come back to
const
!so,
✅ That's right
The text was updated successfully, but these errors were encountered: