How can I get a random URL and name using JSON? DISCORDJS

I have a huge database of waifu’s and I want to get a random name with the corresponding image url, how would I do that.

A bit of the json:

    "waifuID": {
        "1": {
            "names": "Megumin",
            "img_url": ""
        "2": {
            "names": "Mai Sakurajima",
            "img_url": ""
        "3": {
            "names": "Zero Two",
            "img_url": ""

I want to get a random ID and display the name and img-url thats in that ID, how would I do that in javascript?

EDIT: I tried doing

        const WaifuNDB = require("../../Database/WaifuNameDB.json")
        const waifunames = 56
        const waifunames2 = Math.floor(Math.random() * waifunames)
        var waifunames3 = waifunames2

        var waifu = WaifuNDB.waifuID.waifunames3.names


The error it gave was,

(node:9072) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'names' of undefined

But it didn’t work

Hey @HK420,

Instead of

var waifu = WaifuNDB.waifuID.waifunames3.names

try using

var waifu = WaifuNDB.waifuID[waifunames3].names

Hope this helps!