let fruit = 'apple'; let fruits = ["apple", "banana", "mango", "orange", "grapes"]; const isArray = (arr) => Array.isArray(arr); console.log(isArray.(fruit)); //output - false console.log(isArray.(fruits)), //output- true
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter