Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8584049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:40:44+00:00 2026-06-11T21:40:44+00:00

I have the JS below. An array of objects. Each object with an s

  • 0

I have the JS below.

  • An array of objects. Each object with an “s” and “e” property.
  • The first for loop is a test to log the “s” and “e” properties for the first item on the array.
  • The second loop is where I want the working code to happen, but I can’t get access to my properties from inside this loop. And this only seems to be happening in IE8 and lower.

The error in IE8 I’m getting is:

‘s’ is null or not an object

Any ideas would be appreciated?

var t = [
    {s: "blah", e: "blah blah"},
    {s: "blah", e: "blah blah"},
    {s: "blah", e: "blah blah"},
    {s: "blah", e: "blah blah"},
];

var obj = t[0];
for (var prop in obj) {
    console.log(prop+": "+obj[prop]);
}

for (var i = t.length - 1; i >= 0; i--) {
    var l = t[i];
    var s = l.s;
    console.log(s);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:40:45+00:00Added an answer on June 11, 2026 at 9:40 pm

    You have a comma after the last object in your t array. Remove it, because it is getting an undefined as your first object in the loop, because in IE8 it would not initially throw an error but it would acquire an empty object. This is the reason why you get the error.

    Your code:

    var t = [
        {s: "blah", e: "blah blah"},
        {s: "blah", e: "blah blah"},
        {s: "blah", e: "blah blah"},
        {s: "blah", e: "blah blah"},
        undefined // How IE8 parses it and your loop starts here
    ];
    

    This wouldn’t throw errors:

    var t = [
        {s: "blah", e: "blah blah"},
        {s: "blah", e: "blah blah"},
        {s: "blah", e: "blah blah"},
        {s: "blah", e: "blah blah"} // No comma so array is terminated here
    ];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a figure below: And my question is that the objects in Array
Hi guys i have my array below and i want to retrieve two rows:as
I have an array of array like below with all numeric values. I want
I have an array of arrays that is currently printing each object in the
So in struts I have an action form which has 5 properties. Each property
I have a tree that consists of several objects, where each object has a
I have two array list. Each has list of Objects of type Employee. The
i have an array below string stringArray = new stringArray[12]; stringArray[0] = 0,1; stringArray[1]
i have an array like below int[] array = new array[n];// n may be
I have this code below: $insert = array(); for ($i = 1, $n =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.