For example if I had "scissors" in variable and wanted to know the position of all occurrences of the letter "s", it should print out 1, 4, 5, 8  How can I do this in JavaScript in most efficient way? I don't think looping throu...
Can an array in JavaScript be associative AND indexed?  I'd like to be able to lookup an item in the array by its position or a key value....
I have a list being dynamically generated and then I click on the item and pass the index() to another function.  The problem is that this list is being populated dynamically and my code does not respond when I do click event. BUT, if I add a couple...
I'm looking for a good open source (with LGPL or a permissive license) indexing engine for a node.js application, something like Lucene. I'm looking for in-process indexing and search and am not interested in indexing servers like Sphinx or...
I am using AngularJS and its ng-repeat directive to display a sequence of questions. I need to number each question starting with 1. How do I display and increment such a counter with ng-repeat? Here is what I have so far:  <ul>     <li ng-r...
I have a regexp:  /(alpha)|(beta)|(gamma)/gi   Some text to match against:  Betamax. Digamma. Alphabet. Hebetation.   The matches are:  beta, gamma, alpha, beta   The values I am looking would be:  1,2,0,1   ...can I ascertain the index of the group...
So I am using Algolia.com to index users for quick searching.  An example object in index:  {     id: 1,     username: "john.doe",     name: "John Doe",     attributes: {         gender: "male",         hair_color: "blonde...
What is wrong in this class in CoffeeScript ??  @module "Euclidean2D", ->   class @Point     constructor: (x,y) ->        return if Float32Array? then Float32Array([ x, y ]) else Array(x,y)   I want it to behave like:   p = new Point(1....
I'm building a server using Node.js. I store the objects representing my users in an associative array and right now the index of those objects are the sockets id of that connection. Using the Socket.io library i obtain it by simply doing socket....

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.