Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to debug this function. It is saying CANNTO READ PROPERTIES OF NULL(reading zero) function clicked() {

I need to debug this function. It is saying CANNTO READ PROPERTIES OF NULL(reading zero)

 

 

 

 

 

 

function clicked() {


     
var search = document.getElementById("search");
var results = localStorage.getItem(search);

if(results = null)
 {
  document.getElementById("results").innerHTML = "There are no results for that route name."
 }
 else
 {
 
           var stops = results;
  var output='';

  for(var key in stops[0])
  {
               //5
   var output = output + '' + key + ' : ' + stops[0][key] + '
';
  }
  document.getElementById("result").innerHTML = output;
 }


};

Step by Step Solution

There are 3 Steps involved in it

Step: 1

It looks like there are a couple of issues in your code that need to be fixed 1 In the if statement ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Management Accounting Information for Decision-Making and Strategy Execution

Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young

6th Edition

137024975, 978-0137024971

More Books

Students also viewed these Programming questions

Question

What does SMART stand for? (p. 86)

Answered: 1 week ago

Question

The brain emits large, slow delta waves during _______ sleep.

Answered: 1 week ago