How do I turn an object into an array?

  • 0
    (a + b) * c = answer. How do I turn the answer into an array?
    JavaScript Anonymous, Jun 17, 2019

  • 3 Answers
  • 0
    Array.of ((a + b) * c)

    Documentation for Array.of
    Myles Mendez

  • 0
    create an array and write this value there ...
    Anonymous

  • 0
    If I understand correctly ...



    let array = [];

    let object = {name: `Egor`, something: 'something'}

    for (let property in object) {
    if (object.hasOwnProperty(property)) {
    array.push(property)
    }
    }
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!