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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:04:00+00:00 2026-06-01T16:04:00+00:00

I have an array with the following data var a = [1,2,3,4,5,6,7] I am

  • 0

I have an array with the following data

var a = [1,2,3,4,5,6,7]

I am looking for a method in underscore.js or backbone.js in which I can return the elements with a specified range. for ex:

filter(2,5) should return  [3,4,5,6] 

which is the 2nd to 5th index elements in the array. Any pointers for me ?

  • 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-01T16:04:00+00:00Added an answer on June 1, 2026 at 4:04 pm

    Javascript Array should be defined like below,

    var a = [1,2,3,4,5,6,7]; //not inside {}
    

    And then you can use array native slice method to get elements from a specific position

    a.slice(2, 6) //should return 3,4,5,6
    

    Edit:

    I very well know that the functionality is available in JScript. I was asking if its available in backbone or underscore. You are asking like why would you want an ice cube instead of water because ice will turn to water eventually.

    Underscore js do not have function like slice as it is already available in native js.

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

Sidebar

Related Questions

I have an array like the following var data = [ [1, 101_30.1.101_34,0.0200112629,mm/s,[OK]], [1,
I have the following array as3 example: var arrayDefinitionsargsAmfPhp:Array = new Array(); arrayDefinitionsargsAmfPhp['tabela'] =
I have the following array: var idParam = [1,2,3]; I want to send this
I currently have the following javascript array: var stuffs = ['a', 'b']; I pass
I have the following question regarding Flex/AIR data grids: Can I access the value
I have an array of javascript objects like the following: var food = [
I have an array of values in Javascript as follows: var data = {A,
Suppose I have the following code: ... var data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil]; NSLog.trace(@getdData:
I have the following array setup, i,e: var myArray = new Array(); Using this
i have following data as an associative array array 'abc' => array 'label' =>

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.