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 8380979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:35:50+00:00 2026-06-09T16:35:50+00:00

I have been trying to figure out how to get to a base js

  • 0

I have been trying to figure out how to get to a base js array so that I can loop over it
http://emberjs.com/documentation/#toc_the-enumerable-interface

This one is simple. To convert an Enumerable into an Array, simply
call its toArray method.

Now when i run the following test with either 1.pre and 0.9.8.1 the results are not what I’d expect.

> var msp = ["1","2","3"]

> msp
["1", "2", "3"]
> for (mp_c in msp) console.log(mp_c);
0
1
2
isEnumerable
nextObject


> for (mp_c in msp.toArray()) console.log(mp_c);
0
1
2
isEnumerable
nextObject

I would expect it to return a vanilla array, without any of the ember properties.
https://github.com/emberjs/ember.js/blob/master/packages/ember-runtime/lib/mixins/enumerable.js#L554

  • 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-09T16:35:51+00:00Added an answer on June 9, 2026 at 4:35 pm

    Ember actually applys methods onto the Array.prototype; meaning those methods will be on every array on the site (the Array object classes are actually changed, they do not change each instance).

    This actually happens with a lot of javascript libraries so it is always best to iterate over the length (by best I really mean, least brittle using libraries like ember).

    for(var mp_c, i=0, j=msp.length; i<j; i++){
        mp_c = msp[i];
    } 
    

    Edit: ij

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to figure out how to get files that are at
I have been trying to figure out how to modify my query to get
I have been trying to figure out why i cant get even the most
I have been trying to figure out how to get a list of all
I have been trying to figure out how to get the play symbol on
I have been trying to figure out how to consistently get an absolute path
I have been trying to figure out regex myself and to no avail can
I have been trying to figure out why I am getting this problem and
I have been trying to figure out how to read paragraph content which exists
I have been trying to figure out how to open a file from the

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.