You can try this. This will store last item. Here need to convert obj into array. Then use array pop() function that will return last item from converted array.
var obj = { 'a' : 'apple', 'b' : 'banana', 'c' : 'carrot' };
var last = Object.keys(obj).pop();
console.log(last);
console.log(obj[last]);