[Solved] How to access property of JavaScript object, given string with property’s name
Let’s look at the code you’re trying to use: $http.get( ‘url’ ) .success(function(data) { var response = angular.fromJson(data); var mobilereceiver=”0147852369″; var messageId = response.ok.mobilereciever; }); You’re very close, in that you recognize that your string mobilereceiver holds the value that needs to be provided as the name of the final property. However, on your last … Read more