0

I receive an array from a Session.get(), that I then save to a clickedImages variable, as per code below:

var clickedImages = Session.get('clickedImages'); 
console.log("clickedImages is: " ,...clickedImages);

The code above yeilds:

Object {imageId: "ikrbCDuttHrwkEcuv"} Object {imageId: "e72HwJhHyjDhDogJK"} Object {imageId: "GttzCQLzMeqjJP4Ae"} 

To enable me to do further processing, I am only interested in the "imageId" property, that's to say, the desired output is:

"ikrbCDuttHrwkEcuv", "e72HwJhHyjDhDogJK", "GttzCQLzMeqjJP4Ae" 

How do I achieve this?

I have tried and failed achieving this with: console.log("clickedImages is: " ,...clickedImages.imageId);

SirBT
  • 1,580
  • 5
  • 22
  • 51
  • 5
    `clickedImages.map(i => i.imageId)` – Tushar Apr 17 '17 at 12:06
  • 2
    https://en.wikipedia.org/wiki/I_before_E_except_after_C –  Apr 17 '17 at 12:08
  • 1
    "element" refers (usually) to either an HTML element, or a member of an array. `imageId` is a **property**. –  Apr 17 '17 at 12:10
  • @torazaburo Actually in my code, the imageId isnt a property, but rather an element which holds a specific value of interest. Sorry that in my initial posting i referred to imageId as a property – SirBT Apr 24 '17 at 07:50

0 Answers0