There is an object for storing a multi-level list.

var x = { "Toyota": { "Corolla": { "Поколение 1990-97": null, "Поколение 1999-2002": null, "Поколение 2001 -2004": null }, "Rav 4": null, "Land Cruiser": null, "Avensis": null }, "Volkswagen": null, "Ford": null } 

How to display the keys of the first level - Toyota, Volkswagen, Ford?
How to display the keys of the second second, for example - Corolla, Rav 4, Land Cruiser, Avensis?
How to add-delete keys in the "branch" of this object?

    1 answer 1

    How to display the keys of the first level - Toyota, Volkswagen, Ford?

    There is a great Object.keys() function:

     var x = { "Toyota": { "Corolla": { "Поколение 1990-97": null, "Поколение 1999-2002": null, "Поколение 2001 -2004": null }, "Rav 4": null, "Land Cruiser": null, "Avensis": null }, "Volkswagen": null, "Ford": null } console.info(Object.keys(x)); 

    How to display the keys of the second second, for example - Corolla, Rav 4, Land Cruiser, Avensis?

    Just like the first level, just pass a link to the desired level in Object.keys :

     var x = { "Toyota": { "Corolla": { "Поколение 1990-97": null, "Поколение 1999-2002": null, "Поколение 2001 -2004": null }, "Rav 4": null, "Land Cruiser": null, "Avensis": null }, "Volkswagen": null, "Ford": null } console.info(Object.keys(x.Toyota)); 

    How to add-delete keys in the "branches" of this object?

    Adding occurs by setting the property (that through the point with the assignment).
    Delete property / method can delete operator:

     let x = {}; // Добавление: x.some = 'thing'; console.info(x.some); // thing // Удаление: delete x.some; console.info(x.some); // undefined 


    I advise you to learn the basics of working with objects, for example, here .