If you represent your collection as an array, it'sit'll becomes easier to do this kind of things:
const currencyTypes = [ { "ticker": "NOK", "value":1.00000, "name": "Norske kroner", "denomination": "kr" }, { "ticker": "EUR", "value":0.10733, "name": "Europeiske euro", "denomination": "€" }, { "ticker": "USD", "value":0.12652, "name": "United States", "denomination": "$" }, { "ticker": "GBP", "value":0.09550, "name": "Pound sterling", "denomination": "£" } ]; // Amount of currencies: console.log( 'There are ' + currencyTypes.length + ' currencies in the array' ); // Array of all currency tickers: console.log( currencyTypes.map( currency => currency.ticker )); // Console.logging all of them: currencyTypes.forEach( currency => console.log( currency )); // Console.logging the properties using destructuring: currencyTypes.forEach(({ ticker, value, name, denomination }) => console.log( ticker, value, name, denomination )); When you have multiples of something, arrays are usually the easiest way since most objects representing collections can be created from the array in one line of code.
If you want to stay with using an object, look at Object.keys(), Object.values() and Object.entries(). Those will do alot of the converting back and forth from objects to arrays.
The function you coded to get the amount of keys in the object, basically is the same as Object.keys():
const currencyTypes = { NOK: {value:1.00000, name: "Norske kroner", denomination: "kr" }, EUR: {value:0.10733, name: "Europeiske euro", denomination: "€" }, USD: {value:0.12652, name: "United States dollar", denomination: "$" }, GBP: {value:0.09550, name: "Pound sterling", denomination: "£" }, }; console.log( 'there are ' + Object.keys( currencyTypes ).length + ' currencies' );