javascript - Check if an array is empty or not - Postman - node.js -
i getting response in format:
{ "test1": [], "test2": [], "test3": [], "test4": null, "test5": [] }
after sending request, response get.
and want check f. ex. test1
empty or not.
and if empty it's enough console log.
i think looking . using .length
property of array
let response = { "test1": [], "test2": [], "test3": [], "test4": null, "test5": [] } if(response){ if(response.test1.length == 0) { console.log("array empty"); } }
Comments
Post a Comment