0

So i want to get a specific key value by passing key as a parameter to a function.
so from below code given the key can be anything.
so as per the parameter i want to find value respectively.
I have also parsed it as json(it is already a json object)

Here is my json file :

{
  request_id: '0f8e1864-1b49-734c-b0b6-094c6dfe433c',
  lease_id: '',
  renewable: false,
  lease_duration: 600,
  data: {
    aws_access_key_id: '***',
    aws_secret_access_key: '***',
    cls_pepper: '****',
    ssl_password: '****',
    wildcard_ssl_password: '***'
  },
  wrap_info: null,
  warnings: null,
  auth: null
}
function get(secret){
  secrets = JSON.parse(JsonObject);
  **dont know the rest code**

}
  • 1
    Please read through the [help center](https://stackoverflow.com/help), in particular [How do I ask a good question?](/help/how-to-ask) Your best bet here is to do your research, [search](/help/searching) for related topics on SO, and give it a go. If you get stuck and can't get unstuck after doing more research and searching, post a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of your attempt and say specifically where you're stuck. People will be glad to help. – palaѕн Mar 19 '20 at 12:09
  • 1
    [There's no such thing as a "JSON object"](http://benalman.com/news/2010/03/theres-no-such-thing-as-a-json/). The content of `secrets` is an object and not [JSON](https://www.json.org/json-en.html) – Andreas Mar 19 '20 at 12:10
  • What is the output you're expecting? – Avanthika Mar 19 '20 at 12:11
  • @Avanthika — It might be a string of JSON. There's nothing to show how the data gets from the "json file" to the `get` function. – Quentin Mar 19 '20 at 12:21

0 Answers0