Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • May 10 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 27 19:46
    @mstellaluna banned @zhonghuacx
  • Apr 25 17:12
    @mstellaluna banned @cmal
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:09
    thecodingaviator commented #31179
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:07
    thecodingaviator commented #31182
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator commented #31190
  • Apr 01 18:05
    thecodingaviator commented #31157
  • Apr 01 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

  • Apr 01 18:04
    thecodingaviator closed #31157
  • Apr 01 18:04
    thecodingaviator closed #33788
  • Apr 01 18:04
    thecodingaviator commented #33788
  • Apr 01 18:02
    thecodingaviator closed #31059
Julie Myers
@BlueOceanView
:P I know. It's late...I tend to just babble.
Nathan
@terakilobyte
typing just a function or really anything that doesn’t result in an expression will show undefined in the console
Andrew Corcoran
@corca
I feel like I need to review all of the above….tomorrow.
Suzanne Atkinson
@AdventureBear
you guys have been a great help, i'm going to get some shut eye. Well, beer eye, then shut eye. thanks
Nathan
@terakilobyte
lol
Ryan Malm
@Rybar
that makes sense
Nathan
@terakilobyte
I do love javascript
so many little fun corners to explore
Ammar Ali Shah
@AmmarAliShah
Hey here's a very nooby JS question
How do I iterate over an array of numbers and calculate the sum?
Darryl Dixon - Piece Digital
@piecedigital
reduce
i think
Julie Myers
@BlueOceanView
There is an array method that does that.
Suzanne Atkinson
@AdventureBear
Ok, well this is just a mess. Hope it's good for a laugh for someone
Nathan
@terakilobyte
reduce
Suzanne Atkinson
@AdventureBear
function mutation(arr) {


  function isInElement(element,index,array) {
    var second = arr[1].split("");
    var found = true; 

    for (i=0;i<second.length; i++)
    {     
      if (element===second[i]){

      } else {
        found = false; 
      }


      return found; 
    }
  }

  result = arr[0].split("").find(isInElement);

  return result; 



}

mutation(['hello', 'hey']);
Nathan
@terakilobyte
@AdventureBear well...
Ammar Ali Shah
@AmmarAliShah
Nathan
@terakilobyte
can I ask two questions?
@AmmarAliShah yes
Darryl Dixon - Piece Digital
@piecedigital
Yes.
Ammar Ali Shah
@AmmarAliShah
Oh okay I'll read that
thanks all!
:smile:
Nathan
@terakilobyte
@AdventureBear does any mutation of the string ‘bead’ exist anywhere in ‘dabe’ ?
Ammar Ali Shah
@AmmarAliShah
Whenever I read the MDN, it results in me googling a bunch of other stuff I have no idea about
Nathan
@terakilobyte
that’s partly the point
@AdventureBear my follow up question is, does any mutation of the string ‘abde’ exist anywhere in ‘abde’ :)
Cristián Berríos
@crisberrios
I think she went to slepe
sleep
@piecedigital were you able to solve no repeats?
Darryl Dixon - Piece Digital
@piecedigital
@crisberrios No.
Cristián Berríos
@crisberrios
where are you stuck?
Darryl Dixon - Piece Digital
@piecedigital
At the beginning lol
Cristián Berríos
@crisberrios
lol
Darryl Dixon - Piece Digital
@piecedigital
I stopped the mathematical route and tried something else but idk how to do it
Cristián Berríos
@crisberrios
I literally posted an algorithm for permutations in the chat when you were at it
which is the 1st part of the problem using permutations
Julie Myers
@BlueOceanView
@crisberrios and @terakilobyte Would you guys use the module pattern in combo with an event like this:
document.getElementById('sendButton').addEventListener('click', function(){
     console.log(eventsTesting.name);
     eventsTesting.alert();
 }, false);

 var eventsTesting = (function(){
     var name="Snoopy Rules!";
     var alertMe = function(){
         alert("I am inside of the module");
     };
     return {
         name: name,
         alert: alertMe
     };
 })();
Cristián Berríos
@crisberrios
I can give you a hint on math, but you also need permutations
Darryl Dixon - Piece Digital
@piecedigital
@crisberrios I didn't see it.
Cristián Berríos
@crisberrios
scroll up :P
does it work @BlueOceanView ? seems ok at first glance
Darryl Dixon - Piece Digital
@piecedigital
idk what I'm supposed to do with this function permutate ( array) return [] + array.map ( function(item) return permutate(array minus the item) )
Nathan
@terakilobyte
I don’t see why you’d need to export anything
you’re binding the functionality to the ‘sendbutton'
if you wanted to make it so it could be bound to any button then yes, and then pass the button in as an argument
Julie Myers
@BlueOceanView
@crisberrios It does work. I just want to make sure I'm not developing bad coding practices.
Cristián Berríos
@crisberrios
it's "pseudo" js... add a few curly braces and turn the words into functions and variables
Julie Myers
@BlueOceanView
@terakilobyte So, for a single button just put the functionality inside of the addEventListener function?