Convert list to array in JavaScript
const list = {"value":10,"rest":{"value":20,"rest":null}}; function list_to_array(list) { arr = []; for (const property in list) { if (property == "value") { arr.push(property); } else if (property == "rest") { for (const property in rest) { arr.push(property); } } } }…