Created
February 24, 2024 13:15
-
-
Save geraldotech/e4564f89aed3c907b6b3bb0076290a71 to your computer and use it in GitHub Desktop.
Handler isArrayWithObjects
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
import React from 'react' | |
export default function isArrayWithObjects(arr) { | |
const check = Array.isArray(arr) && arr.length > 0 && arr.every(item => typeof item === 'object' && item !== null && !Array.isArray(item)); | |
return check | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment