{"id":12692,"date":"2022-10-03T15:23:50","date_gmt":"2022-10-03T19:23:50","guid":{"rendered":"http:\/\/local.brightwhiz\/?post_type=snippets&p=12692"},"modified":"2022-10-03T15:23:53","modified_gmt":"2022-10-03T19:23:53","slug":"how-to-check-value-is-array-or-not-in-javascript","status":"publish","type":"snippets","link":"http:\/\/local.brightwhiz\/snippets\/how-to-check-value-is-array-or-not-in-javascript\/","title":{"rendered":"How to Check Value is Array or not in JavaScript"},"content":{"rendered":"\n
Use this to check if value is array or not in JavaScript:<\/p>\n\n\n\n
const str = "foo";\nconst check = Array.isArray(str);\nconsole.log(check);\n\n\/\/ Result: false<\/code><\/pre>\n\n\n\nconst arr = [1,2,3,4];\nconst output = Array.isArray(arr);\nconsole.log(output);\n\n\/\/ Result: true<\/code><\/pre>\n","protected":false},"comment_status":"open","ping_status":"closed","template":"","meta":[],"categories":[953,23,27,15,16],"tags":[320,328,433,635,638],"yoast_head":"\nHow to Check Value is Array or not in JavaScript [Snippet]<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n