JSFiddle - React, Tailwind, and code Playground

by Gerald Fullam

JavaScript

var jobs = [
    {
        // hunting
        name: 'Hunting',
        available: [
            {
                name: 'Housemate',
                description: 'You stick around the cabin of the hunters. You are the lowest class of the hunters.',
                salary: 10
            }, {
                name: 'Fetcher',
                description: 'You are the fetcher of the clan. You gather leather, resources, and skin leather.',
                salary: 15
            },  {
                name: 'Hunter',
                description: 'You are a basic hunter of the clan. You hunt for food, meat, and leather.',
                salary: 25
            },  {
                name: 'Elder',
                description: 'You are a elder of the clan. You are respected among many, and may ask hunters for arrons.',
                salary: 0
            }
        ]
    }, {
        // construction
        name: 'Construction',
        available: [
            {
                name: 'Builder',
                description: 'You are a builder. You are the lowest class of the construction tier.',
                salary: 45

            }, {
                name: 'Driver',
                description: 'You are a driver. You do the fetching and gathering of resources.',
                salary: 55
            }, {
                name: 'Engineer',
                description: 'You are a engineer. You do the wiring and electrical work in the construction.',
                salary: 65
            },  {
                name: 'Overseer',
                description: 'You are the overseer. You watch over the construction and give orders.',
                salary: 80
            }
        ],
    }
];

console.log(jobs[0].name); // Returns 'Hunting'
console.log(jobs[0].available[1].name); // Returns 'Fetcher'
console.log(jobs[0].available[3].salary); // Returns '0'

// Return object whose property of 'name' has a value of 'Hunting'
console.log(_.find(jobs, function(obj) { 
   ...