I have a JavaScript Object and I'm sure the value of any key is an array (even empty in some case):  {key1:["a","b","c"],key2:["d","e","f"],key3:...}   Aside from using Underscore, is there any way...
I've got a problem, regarding gulp. I decided to automate the process of how the source and styles are compiled into a single file, so I decided to use gulp for that purpose. However, it doesn't want to overwrite the application.js file that...
function whatTheHeck(obj){   var arr = []    for(o in obj){     arr.concat(["what"])   }    return arr }  whatTheHeck({"one":1, "two": 2})   The concat function completely fails to do anything. But if I put a breakpoint on tha...
I am attempting (unsuccessfully) to write JavaScript function LetterCount to count the consecutive letters in a string (and not the total number).   Ideally:     LetterCount("eeeeeoooohhoooee") = [["e", 5],["o",3],["h"...
I want to write a method which filters data for multiple criteria. These criteria should by passed as functions to the filter-function, for example:  var products = [/* some data */]; function filterMyProducts(criteria) {    return products.filter(/*...
I used grunt-contrib-concat alot and wondered why some files were not concatenated. I found out it was a small typo. Anyway, I've got a lot of different files with different destinations.   grunt.initConfig({   concat: {     js: {       files: [...
To be more specific is there a simplier way of doing this:  var test0 = [[0,2,4], [1,3,5]]; var test1 = [[6,8], [7,9,11]];  test0.forEach(     function(item0, index) {         test1[index].forEach(             function(item1) {                 item0....
I am pretty new to javascript and I have an issue with flattening several arrays into one complete array using the reduce and concat function.  var array = [ [1, 3], [6, 6], [3, 3] ];   var finishedArray = function(array) { var reducedArray = {}; var...
I am working on a directive that is going to disable all form elements on the page based on a rootScope variable (similar to adding ng-disabled to every item manually, but just a more convenient way.  I'm reworking an existing app and don't w...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.