Skip to navigation
Check if a JavaScript object is an array or dict
24.02.22
var dict = { a: 1, b: { c: 3, d: 4 }, e: 9 }; // this function will true / false const isDict = dict => { return typeof dict === "object" && !Array.isArray(dict); }; console.log(isDict(dict)); // true
https://stackoverflow.com/questions/38304401/javascript-check-if-dictionary
Reply
Anonymous
Information Epoch 1753512247
Save trees.
Home
Notebook
Contact us