I would expect this line of JavaScript:  "foo bar baz".match(/^(\s*\w+)+$/)   to return something like:  ["foo bar baz", "foo", " bar", " baz"]   but instead it returns only the last captured match:  ["fo...
In Perl I can repeat a character multiple times using the syntax:  $a = "a" x 10; // results in "aaaaaaaaaa"   Is there a simple way to accomplish this in Javascript? I can obviously use a function, but I was wondering if there was...
I was wondering if there is a way to check for repeated characters in a string without using double loop. Can this be done with recursion?  An example of the code using double loop (return true or false based on if there are repeated characters in a...
I try to match/get all repetitions in a string. This is what I've done so far:  var str = 'abcabc123123'; var REPEATED_CHARS_REGEX = /(.).*\1/gi;  console.log( str.match(REPEATED_CHARS_REGEX) ); // => ['abca', '1231']...
I'd like to find the longest repeating string within a string, implemented in JavaScript and using a regular-expression based approach.  I have an PHP implementation that, when directly ported to JavaScript, doesn't work.  The PHP implementat...
I want take a section of a picture, for example the middle of a picure, and repeat only that section in the background of a div. Is this even remotely possible? I suppose I could do this in javascript, but that would be messy.   In theory the answer...
I'm new student in here,sorry for asking simple question and I'm trying to solve a problem to count a same letter.  Input:"aabbcde" cause a = 2, b= 2, c= 1 , d =1 , e = 1 Output:"2a2b1c1d1e" or a2b2c1d1e1   and here's my c...
I've been trying to make a raphael animation, it's working fine and animating on load as it should but.. I want it to animate AGAIN when clicking a text or button (a div outsite raphael paper).  Raphael Code is here:  window.onload = function...
I'm using the setInterval function in JavaScript but I get like one hundred reps per second from the console.log('NOW'). setTimeout also has the same effect.  Where is my mistake? I want to call the function "function1" every 15 m...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.