Created
July 8, 2021 15:21
-
-
Save ratul16/c8b1b5a45b1967b974fb507ed02409fa to your computer and use it in GitHub Desktop.
Empty array check #FoolProof Method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!Array.isArray(data) || !data.length) { | |
| this.not_found = true; | |
| console.log('empty'); | |
| } else { | |
| this.addresses = response.data.result; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment