tonic + npm: lodash

const get = require("lodash").get; const a = { 'model.id': 1234, model: { id: 9876 } }; const b = { model: { id: 9876 }, 'model.id': 1234 }; console.log(get(a, 'model.id')); console.log(get(a, ['model', 'id'])); console.log(get(b, 'model.id'));
Created from: https://tonicdev.com/npm/lodash
Loading…

no comments

    sign in to comment