Skip to content

Instantly share code, notes, and snippets.

@mijms
Created July 22, 2021 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mijms/a3e5a38448521e6af8e624bf2eb2c970 to your computer and use it in GitHub Desktop.
Save mijms/a3e5a38448521e6af8e624bf2eb2c970 to your computer and use it in GitHub Desktop.
import {get} from 'lodash'
let x = {a: 1, b:2}
// a and b is conditional key like if key == a
let hope = get(x, 'kkk', 'not exist');
// magic is just happen not exist is appear welcome lodash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment