Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
Unexpected ')' token

I am working on javascript objects. I am creating an array for 'Parrot Computer'. When I run the following code, it does not display on the browser and there is a javascript error message: unexpected ')' token. Kindly assist.

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Objects</title>
    <script>

        function f1(){
            var commodity={
                Id : 1,
                Name : "Parrot Computer",
                price : "350.00",
                IsInStock : true,
                Quantity : 5,
                shippedTo : ['San Francisco', 'Los Angeles'],
                Total : function(){
                    return commodity.Quantity*commodity.price;

                }

            }
            if(commodity.IsInStock==true)
            stock="Available";
            else
              stock="out of stock";

              document.write("Id : " +commodity.Id+  "<br>" + "Name=" +commodity.Name+ "<br>" + "price= " +commodity.price+ "<br>" + "Is in stock" +stock+ "<br>" + "shipped to =" +commodity.shippedTo+ "<br>" + "Total Amount " +commodity.Total()+)

        }
        f1();
    
    </script>
  </head>
  <body>
    
  
  </body>
</html>




  
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!