Error when parsing simple JSON

I am getting an error on a simple JS

Here is the JSON being sent. Very simple:

{
  "status": "Paid",
  "businessId": "133",
  "loanamount": 50001
}

Here is my code:

export async function post_editBusiness(request) 
{

      let options = {
        "headers": {
          "Content-Type": "application/json"
        }
      };

      let opt = {
        "suppressAuth": true,
        "suppressHooks": false
      };

      //get the request body
      return request.body.text()
        .then( (body) => {
          let obj = JSON.parse(body)

          Let businessId = obj("businessId").toString()
          let loanamount = obj("loanamount").toString()

        } );
    
}

And when running in the console, I always get this error:
obj is not a function

If someone can help me solve this simple (but annoying) issue, I would greatly appreciate it!

Thanks!

Hey @Len_Perroots! :wave:

When you want to access the value of a property in an object using a variable, you should use square brackets [], not parentheses (). The corrected code uses obj["businessId"] and obj["loanamount"] to access the properties of the obj object.

You can also do this through dot notation, for example, obj.businessId and obj["loanamount"]. Both notations are work, and you can choose the one that you find more readable or suitable for your coding style.

Thanks! I was able to get it to work like this before your response:

Let businessID = obj.businessID.

I didn’t realize that you could do it both ways!
Appreciate your help!