Q:

get attribute from json javascript

I am trying to extracts some attribute values from an JSON output but I haven't been able to do that, I need to feed each of the value extracted into a function, any help is appreciated! please find below the JSON, I need to extract the filename value as a string in javascript. so the result should be 2389063RX2_000003.tif,
2389063RX2_000004.tif, 2389063RX2_000002.tif.
thanks in advance
{
  "Items": [
    {
      "filename": {
        "S": "2389063RX2_000003.tif"
      },
      "LastChecked": {
        "S": "2013-10-16"
      },
      "Checkdate": {
        "S": "2017-10-16"
      },
      "ContentType": {
        "S": "image"
      },
      "UID": {
        "S": "2389063RX2_000003"
      },
      "md5": {
        "S": "e2670dc6daded994066942004c1f6806"
      }
    },
    {
      "filename": {
        "S": "2389063RX2_000004.tif"
      },
      "LastChecked": {
        "S": "2015-10-16"
      },
      "Checkdate": {
        "S": "2017-10-16"
      },
      "ContentType": {
        "S": "image"
      },
      "UID": {
        "S": "2389063RX2_000004"
      },
      "md5": {
        "S": "\nd1979275e0add942356b5b472fbadc73"
      }
    },
    {
      "filename": {
        "S": "2389063RX2_000002.tif"
      },
      "LastChecked": {
        "S": "2016-10-16"
      },
      "Checkdate": {
        "S": "2017-10-16"
      },
      "ContentType": {
        "S": "image"
      },
      "UID": {
        "S": "2389063RX2_000002"
      },
      "md5": {
        "S": "a48974a06a11d8548bedfcac7b5624ec"
      }
    }
  ],
  "Count": 3,
  "ScannedCount": 3
}

A:

this is what you need I guess. Iterate though this json object and capture the filename only.
ES6
let arrayOfFilenames = jsonVariable.items.map((e) => e.filename);

ES5
var arrayOfFilenames = jsonVariable.items.map(function (e) {
    return e.filename;
});

