These are chat archives for FreeCodeCamp/HelpJavaScript

17th
Nov 2017
Jonathan Bell
@jonathanbell
Nov 17 2017 00:14

I'm working with an NPM package that provides a wrapper to an API. The API requires a fresh key/token be used after the previous session has been closed. The original author of the NPM package persists this data by writing a file with the newly issued/refresded value to disk, like this:

Questrade.prototype._saveKey = function (cb) {
  cb = cb || function(){};
  var self = this;
  fs.writeFile(self._getKeyFile(), self.refreshToken, 'utf8', function (err) {
    if (err) return cb({ message: 'failed_to_write', details: err });
    cb(null, self.refreshToken);
  });
}

I would like to modifiy _saveKey() so that it writes the value to my database instead of to a file. I would also like to "overwrite" _loadKey() so that when it is called, it gets the key value from the database.

I've never before "overrided" a function like this in Node that has been set in an NPM package. How should I do this? Do I just redefine Questrade.prototype._saveKey() somewhere in my code after I have required the package? (Questrade.prototype._saveKey = function() {};)

Thanks in advance for your help and time.

Christopher Brown
@ChrisBrownie55
Nov 17 2017 00:59
Hey, I'm having some trouble with making a CORS xhr GET request to Wikipedia's API. Any advice? I'm getting the notorious Reason: CORS header ‘Access-Control-Allow-Origin’ missing even though I've run xhr.open( method, url, true ) and even xhr.withCredentials = false but still no avail
Moisés Man
@moigithub
Nov 17 2017 01:00
use origin=* wiki api param
Kaz Baig
@kbaig
Nov 17 2017 01:00
bad documentation, feels bad
Christopher Brown
@ChrisBrownie55
Nov 17 2017 01:12
@moigithub freaking thank you man! I even saw Unauthenticated CORS requests may be made from any origin by setting the "origin" request parameter to "*" on the wiki api cors page but I tried to do xhr.setRequestHeader and @kbaig you're right bad documentation does feel bad.
CamperBot
@camperbot
Nov 17 2017 01:12
chrisbrownie55 sends brownie points to @moigithub and @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 425 | @kbaig |http://www.freecodecamp.org/kbaig
:star2: 3713 | @moigithub |http://www.freecodecamp.org/moigithub
silver537
@silver537
Nov 17 2017 02:40
That's not bad documentation, just bad interpretation.
Kaz Baig
@kbaig
Nov 17 2017 02:48
It's hard to find mate
Please ask, what is wrong with this question?
Conor Murphy
@cmurphy580
Nov 17 2017 07:44
does the display inline flex prevent the right margin on the last card from showing up?
https://codepen.io/cmurphy580/pen/WXEZrw?editors=1101
Sherlock Holmes
@GGX666
Nov 17 2017 08:02
hi guy
Sherlock Holmes
@GGX666
Nov 17 2017 08:08
@cmurphy580 flex-end
try
Donnie
@Donnie-D
Nov 17 2017 09:34
can somebody tell whats wrong with this little takeout. its not returning the value of s
<!DOCTYPE html>
<html>
  <body onload="myFunction">
      <p id="demo"></p>
    <script>
      function myFunction(){
          var s=5+7;
          return s;
     } 
    document.getElementById("demo").innerHTML=s;
    </script>
  </body>
</html>
Tam Nguyen
@bankplank
Nov 17 2017 09:37
You're not calling the function
Donnie
@Donnie-D
Nov 17 2017 09:37
grrrr
just saw it
im so dumb
Markus Kiili
@Masd925
Nov 17 2017 09:38
@Donnie-D You should also do the DOM manipulation inside the function where you calculate s.
Donnie
@Donnie-D
Nov 17 2017 09:39
@Masd925 like this?
<!DOCTYPE html>
<html>
  <body onload="myFunction()">
      <p id="demo"></p>
    <script>
      function myFunction(){
          var s=5+7;
           document.getElementById("demo").innerHTML=s;
     } 

    </script>
  </body>
</html>
sorry forgot to takeout the return statement :smile:
Ahmad Abdolsaheb
@ahmadabdolsaheb
Nov 17 2017 09:44
hey does anyone know the difference between linters and style guides for javascript. I already use jslint, i don't know how airbnb style guide will improve me code. thank you
Markus Kiili
@Masd925
Nov 17 2017 09:51
@Donnie-D Does it work?
Donnie
@Donnie-D
Nov 17 2017 09:54
@Masd925 well.. thanks for asking . basically i broke down my code earlier to figure out what the issues might be. it doesn't return a result
<!DOCTYPE html>
<html>
<body onload="myFunction()">
<p id="demo"></p>

<script>
function myFunction(){
    var today= new Date();
    var h= today.getHours();
    var m= today.getMinutes();
    var s= today.getSeconds();
    document.getElementById("demo").innerHTML= h+" :"m+" :"+s ;
}
</script>
</body>
</html>
CamperBot
@camperbot
Nov 17 2017 09:54
donnie-d sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4576 | @masd925 |http://www.freecodecamp.org/masd925
Markus Kiili
@Masd925
Nov 17 2017 09:55
@Donnie-D First just try to print some text to the screen with that innerHTML line.
Donnie
@Donnie-D
Nov 17 2017 09:55
i did. that showed the result.
now i created the times variables to move on lol
i can't see but probably something is wrong with my variables initialization :smile:
Tam Nguyen
@bankplank
Nov 17 2017 09:59
Are you trying build a clock?
Or the pomodoro project
Donnie
@Donnie-D
Nov 17 2017 09:59
a clock @bankplank
the interesting part is that it prints the results when i individually enter the variables .so variable initialization is fine in the case up there
Tam Nguyen
@bankplank
Nov 17 2017 10:01
document.getElementById("demo").innerHTML= h + ":" + m + ":" + s
thats not going to auto update though
Donnie
@Donnie-D
Nov 17 2017 10:04
<!DOCTYPE html>
<html>
<body onload="myFunction()">


<p id="demo"></p>

<script>
function myFunction(){
    var today= new Date();
    var h= today.getHours();
    var m= today.getMinutes();
    var s= today.getSeconds();
    document.getElementById("demo").innerHTML= h ;
}
</script>
</body>
</html>
this works. and also when i replace h with m or s, they all show their values individually but the combination doesn't show lol
@bankplank yes i tried it but strangely enough its not working. (such a simple piece, i wonder whats wrong). Also yes i know to update i am going to do setInterval
Tam Nguyen
@bankplank
Nov 17 2017 10:05
document.getElementById("demo").innerHTML= h+" :"m+" :"+s ;
you are missing a plus operator between ":" and m
Donnie
@Donnie-D
Nov 17 2017 10:08
@bankplank and the idiot of the group award goes to me. :clap:
@bankplank you little gem :+1:
Donnie
@Donnie-D
Nov 17 2017 10:18
look guys i am becoming a programmer
<!DOCTYPE html>
<html>
<body onload="myFunction()">


<p id="demo"></p>

<script>
function myFunction(){
    var today= new Date();
    var h= today.getHours();
    var m= today.getMinutes();
    m=acc0(m);
    var s= today.getSeconds();
    s=acc0(s);
    document.getElementById("demo").innerHTML= h + ":" + m +":"+ s;
}
function acc0(val){
    if(val<10){
        val= "0" + val;
    }
    return val;    
}
</script>
</body>
</html>
how can we make it a live clock without using setInterval?
or ... can we?
Blauelf
@Blauelf
Nov 17 2017 10:31
We need some re-occurring event, easiest done with setInterval or setTimeout. If you really want to avoid those, there are probably other events one could abuse (maybe start some asynchronous call that takes like forever, but specify a small timeout), but that's like code golf, works, but not to be used in production.
Donnie
@Donnie-D
Nov 17 2017 10:32
<!DOCTYPE html>
<html>
<body onload="setInterval(myFunction,1000)">


<p id="demo"></p>

<script>
function myFunction(){
    var today= new Date();
    var h= today.getHours();
    var m= today.getMinutes();
    m=acc0(m);
    var s= today.getSeconds();
    s=acc0(s);
    document.getElementById("demo").innerHTML= h + ":" + m +":"+ s;
}
function acc0(val){
    if(val<10){
        val= "0" + val;
    }
    return val;    
}
</script>
</body>
</html>
i can do it with setInterval
how can we do it with setTimeout?
@Blauelf
Donnie
@Donnie-D
Nov 17 2017 10:39
I DID IT
<!DOCTYPE html>
<html>
<body onload="myFunction()">


<p id="demo"></p>

<script>
function myFunction(){
    var today= new Date();
    var h= today.getHours();
    var m= today.getMinutes();
    m=acc0(m);
    var s= today.getSeconds();
    s=acc0(s);
    document.getElementById("demo").innerHTML= h + ":" + m +":"+ s;
    setTimeout(myFunction,1000);
}
function acc0(val){
    if(val<10){
        val= "0" + val;
    }
    return val;    
}
</script>
</body>
</html>
Tell anyone looking for a genius... I AM RIGHT HERE
next question....
i want a box to change its message everytime i click on it. a bit vague intro may be
Donnie
@Donnie-D
Nov 17 2017 10:45
for example, first click greets me , second click asks about something else, so on for upto say 5 clicks. After 5 clicks the box says goodbye and disappears. how can we do that
Ever Lord
@ev3rlord
Nov 17 2017 11:25
@Donnie-D So you want to alert your user by saying hello then prompts a yes/no question? Once it hits(variable) 5(value) clicks(method) the box automatically types "Goodbye" and fades away? Done
Stephen James
@sjames1958gm
Nov 17 2017 11:29
@Donnie-D You can use an array of strings for the display and when the array is used up then remove the box. Use the array length for when to make the box disappear.
The box could be a correctly style <p> or <div> which your javascript listens for clicks on
Spyrantis Theodoros
@thodorisanta
Nov 17 2017 13:06
is it possible (and a good idea :P ) to place a set Interval inside a set Interval that will run after the first set interval? :p (note that the first set interval is in a loop of all the objects of an array, so i want the 2nd interval to run after each object of the first set interval)
Ankur sharma
@ankur1163
Nov 17 2017 13:07
if i want to duplicate this
whats the best way to fetch its css
Long Nguyen
@longnt80
Nov 17 2017 13:07
@thodorisanta that is confusing :D
Ankur sharma
@ankur1163
Nov 17 2017 13:10
what do you want to do
@thodorisanta
you wont need 2 timers
Spyrantis Theodoros
@thodorisanta
Nov 17 2017 13:14

@longnt80 hahaha i know sorry :D . bassically i have a set interval that runs for every object of an array (i have a switch inside it. line 30 in my JS) and i want to make an "action" in my code that will happen after each object of the array runs in setInterval.

https://codepen.io/oshikurou/pen/vWGoee?editors=1111

@ankur1163
Long Nguyen
@longnt80
Nov 17 2017 13:15
@thodorisanta I would use setTimeout and recursive
Spyrantis Theodoros
@thodorisanta
Nov 17 2017 13:43
@longnt80 i placed a setTimeout inside interval and it worked. i hope its not "morally wrong" to do it :P
does the rule "if it works its not stupid apply here? :P
Ankur sharma
@ankur1163
Nov 17 2017 13:44
in div
i can use any custom attributes?
like
<div name="something"> </div>
Spyrantis Theodoros
@thodorisanta
Nov 17 2017 13:49
i noticed that clearInterval doesnt actually stop (or interupt) the interval immidiatelly :(
Blauelf
@Blauelf
Nov 17 2017 13:51
It should prevent the interval from triggering again, I think? Maybe you created two intervals accidentally and cleared only one? Or the callback was already enqueued at the time you cleared?
Jasper
@Jasperaine
Nov 17 2017 13:51

Could some body please help me, im stuck on my simon game. im trying to get one of the buttons to flash but its not working.
my code so far: $(document).ready(function(){

var simonSays = [];
var playerSays = [];
var startSwitch = true;
var playerSwitch = true;
var count = 0;

$("#startButton").click(function(){

    if (startSwitch == true) {

        simonFunction();
    }

});

function simonFunction() {

    var colours = document.getElementsById("colours");
    var randomColour = Math.floor(Math.random() * 3);
    simonSays.push(colours[randomColour]);
    count++;

    playSimonSays();
}


function playSimonSays() {

    var i;

    for (i = 0; i < simonSays.length; i++) {
        simonSays[i].addClass(".buttonFlash");

        playerSwitch = true;

    };
}

});

Ankur sharma
@ankur1163
Nov 17 2017 13:56
I have something like this
<div name="something"> </div>
how do i access name?
normally we do e.target.id
if i do e.target.name , it doesnt work
ok i got it
  console.log("e.name ",e.target.getAttribute('name'))
pocahontas123
@pocahontas123
Nov 17 2017 14:03
Hello, i need some advice on a simple javascript question
`code`
`    for( let k = 0; k < strL; k++ ) {
    if( ( regex.test( str[k] ) ) && ( k == 0 ) ) {

    }
}`
My problem is i have issue with my '&&', it doesn't work
Blauelf
@Blauelf
Nov 17 2017 14:05
@pocahontas123
```js Shift+Return for line break in chat mode
var answer = 42;
```
=>
var answer = 42;
@pocahontas123 What is it you are trying to express with this condition?
pocahontas123
@pocahontas123
Nov 17 2017 14:06
Hello @Blauelf
Well, i have a simple regex that find vowel. And if it find a vowel at the first letter, here 0, it's should do some thing
it has to be true (vowel) et k == 0 at the same time
why my && doesn't work
Blauelf
@Blauelf
Nov 17 2017 14:07
What's your regex? And what doesn't work?
pocahontas123
@pocahontas123
Nov 17 2017 14:07
The operator &&
Blauelf
@Blauelf
Nov 17 2017 14:08
@pocahontas123 Have you counted parentheses?
You need as many opening as closing parentheses. I count one extra closing. Oh, nvm, mis-counted.
pocahontas123
@pocahontas123
Nov 17 2017 14:08
@Blauelf yes it's good
Blauelf
@Blauelf
Nov 17 2017 14:08
What's your regex?
pocahontas123
@pocahontas123
Nov 17 2017 14:09
let regex = /[aeiouy]/i;
i just want to make my && work :/
My code will change but for now, i want do make my && work
Blauelf
@Blauelf
Nov 17 2017 14:10
Not sure about y being a vowel (it usually isn't as a character, but it can in pronunciation).
Why do you think && doesn't work?
pocahontas123
@pocahontas123
Nov 17 2017 14:10
I got this console.log( translatePigLatin("a") );
Blauelf
@Blauelf
Nov 17 2017 14:11
There's no way to make && not work, so it might be you're using it wrong in some way. What makes you think it's not working?
pocahontas123
@pocahontas123
Nov 17 2017 14:11
Well, i got this "console.log( translatePigLatin("a") );"
So it must work :))
the str is 'a', it's a vowel and it's the first letter so k == 0
Blauelf
@Blauelf
Nov 17 2017 14:12
What is your code, what do you expect as an output, what does it output?
pocahontas123
@pocahontas123
Nov 17 2017 14:12
for now, there is no code. It's just a console.log() or an alert() to see if it's work
for( let k = 0; k < strL; k++ ) {
    if( ( regex.test( str[k] ) ) && ( k == 0 ) ) {
        console.log("hello");
    }
}
Blauelf
@Blauelf
Nov 17 2017 14:13
What's strL? What's str?
pocahontas123
@pocahontas123
Nov 17 2017 14:13

function translatePigLatin( str ) {
let regex = /[aeiouy]/i;
let strL = str.length;
let newStr = "";

for( let k = 0; k < strL; k++ ) {
    if( ( regex.test( str[k] ) ) && ( k == 0 ) ) {
        console.log("hello");
    }else {
        console.log("sdsd");
    }
}

return newStr;

};

Blauelf
@Blauelf
Nov 17 2017 14:14
Oh. Where do you expect the output of console.log to go?
pocahontas123
@pocahontas123
Nov 17 2017 14:14
It's strange, it's working now...
i got my input :worried:
@Blauelf Thanks you anyway
CamperBot
@camperbot
Nov 17 2017 14:15
pocahontas123 sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 4653 | @blauelf |http://www.freecodecamp.org/blauelf
Spyrantis Theodoros
@thodorisanta
Nov 17 2017 14:24
@Blauelf what i do is while the interval is running if the user clicks a button interval should be stopped ( or interupt) but that doesnt happen.
Blauelf
@Blauelf
Nov 17 2017 14:24

@pocahontas123 In this loop, I'd have nested ifs instead of an &&, like

    for (let k = 0; k < strL; k++) {
        if (regex.test(str[k])) {
            if (k === 0) {
                return str + "way";
            } else {
                return ...
            }
        }
    }

because on first vowel you always know what to return, it just depends on where that first vowel is.

pocahontas123
@pocahontas123
Nov 17 2017 14:25
@Blauelf Yes, but still i don't understand why it didn't work at first :/ Some bug with js maybe.
@Blauelf It's one way to bypass this issue but not knowing why it didn't work was troubling me.
Blauelf
@Blauelf
Nov 17 2017 14:27
@thodorisanta That's why I asked whether you have multiple intervals running. Many people accidentally start multiple intervals, but only keep the handle of the last, and then clear only that one. This is code that breaks on double-click instead of single-click :P
Spyrantis Theodoros
@thodorisanta
Nov 17 2017 14:29
@Blauelf so clearInterval should stop immidiatelly the interval?
Blauelf
@Blauelf
Nov 17 2017 14:32

Should stop the interval that matches the handle you pass. But if you had code like

var handle;
function newInt(callback, interval) {
  handle = setInterval(callback, interva);
}
function remInt() {
  clearInterval(handle);
}

and you called newInt twice, you wouldn't be able to stop the first loop any more, as you lost its handle.

BTW, what makes you believe the interval hasn't stopped? Is it possible that those are delayed actions of callback executions that happened before you cleared the interval?
Blauelf
@Blauelf
Nov 17 2017 14:43
@thodorisanta Are you aware that you have two variables named timer?
Maybe you called clearInterval with the global one while you stored the handle in the local variable.
Spyrantis Theodoros
@thodorisanta
Nov 17 2017 14:56
@Blauelf okay thanks! i fixed it. second timer declaration was the issue :)
CamperBot
@camperbot
Nov 17 2017 14:56
:star2: 4654 | @blauelf |http://www.freecodecamp.org/blauelf
thodorisanta sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
Jason Luboff
@JLuboff
Nov 17 2017 17:02
:fire:
if anyone has the time to check it
function whoIsNext(names, r){
  if(r < 5){
    return names[r];
  }
  let count = 2;
    let arr = [1,1,1,1];
        while(count < r){
        for(let i = 0; i < arr.length; i++){
            arr[i] += count;
            if(eval(arr.join("+")) >= r){
                return names[i];
            }
    }
  count *=count;
  }
}
not sure what im missing
Jason Luboff
@JLuboff
Nov 17 2017 18:38
Hmmmm
I'm going to try it
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 18:39
servers seem to be timing out ever request :D "high server load"
Jason Luboff
@JLuboff
Nov 17 2017 18:39
Well considering the high number...I'm not surprised it would time out
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 18:40
the code doesnt timeout
if you console.log hi
it will timeout
just the usual some days
Ronique Ricketts
@RoniqueRicketts
Nov 17 2017 18:40
about to start fcc mongodb challenge. Any of you nerds done it as yet?
Jason Luboff
@JLuboff
Nov 17 2017 18:40
Oh ya..I just tried to console.log names and r and its going to timeout
@RoniqueRicketts learnyoumongo? It sucks. But good luck
Ronique Ricketts
@RoniqueRicketts
Nov 17 2017 18:41
Lurkers? @JLuboff @tiagocorreiaalmeida @Blauelf @sjames1958gm
@JLuboff ok ill try my best then,
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 18:41
anyway I was running my code on jsfidle for testing porpuse and still can't figure out what's the part im missing :D uh I jumped it
Jason Luboff
@JLuboff
Nov 17 2017 18:41
Anybody done the beta Data viz section? Worth going through?
Looks like it just focuses on D3
Was hoping they had stuff on react...but doesn't look like they have much :(
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 18:44
black friday on udemy a good day for the andrew mead course :D
Ronique Ricketts
@RoniqueRicketts
Nov 17 2017 18:44
@JLuboff they have on beta.
Jason Luboff
@JLuboff
Nov 17 2017 18:45
I'm looking at the beta map...I only see under FrontEnd libraries for react and it doesn't even work properly lol
Ronique Ricketts
@RoniqueRicketts
Nov 17 2017 18:45
@JLuboff also read this it helps alot. go through it. https://reactjs.org/docs/hello-world.html
@JLuboff I know the beta map doesn't work properly.
Jason Luboff
@JLuboff
Nov 17 2017 18:47
Nothing on beta is really working for me. Woner if its firefox or just the site. Oh well..
Kaz Baig
@kbaig
Nov 17 2017 18:48
@JLuboff luckily react/redux beta is not on the beta site, but rather a separate app
Jason Luboff
@JLuboff
Nov 17 2017 18:49
@kbaig Ah! Thank you. And same to you @RoniqueRicketts
CamperBot
@camperbot
Nov 17 2017 18:49
jluboff sends brownie points to @kbaig and @roniquericketts :sparkles: :thumbsup: :sparkles:
:cookie: 428 | @kbaig |http://www.freecodecamp.org/kbaig
:cookie: 408 | @roniquericketts |http://www.freecodecamp.org/roniquericketts
Kaz Baig
@kbaig
Nov 17 2017 18:50
@JLuboff np. The page on the beta site just links you to where I directed you
Jason Luboff
@JLuboff
Nov 17 2017 18:50
I clicked it but it acted like it would work within the same page but the code window didn't display what they said it should lol
Ronique Ricketts
@RoniqueRicketts
Nov 17 2017 18:53
@JLuboff refrersh
Moisés Man
@moigithub
Nov 17 2017 19:10
@tiagocorreiaalmeida :point_up: 17 de noviembre de 2017 13:37 got it :) wanna see ?
did it recursively
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 19:13
@moigithub YEAH :D but plus if you can spot my issue ahah
Moisés Man
@moigithub
Nov 17 2017 19:22
if u have [A,B,C,D,E] (too lazy to write names on quotes /strings)
and wanna know the 1 whos turn to drink
[A,B,C,D,E], 1 should be A ... after A drinked its cola.. it moves to the end.. but doubling turn so becomes [B,C,D,E, A, A]
[A,B,C,D,E], 2 should be B ... cuz [B,C,D,E, A, A] <-- now is B turn (next in queue)
[A,B,C,D,E], 3 should be C ... cuz [C,D,E, A, A, B,B] <-- now is C turn (next in queue)
[A,B,C,D,E], 4 should be D ... cuz [D,E, A, A, B, B,C, C] <-- now is D turn (next in queue)
@tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 19:44
that was something like my idea but I tought of using array positions and simple math I might have some samller issue on it l
Diego Mayer
@Chrono79
Nov 17 2017 20:15
I used a single loop there
and some math
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 20:25
im going back to that akta now and try to spot my issue or at least try to :D
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 20:43
does it doubles the last input or doubles the ammount of persons like lsat time there was 2 shleodns do I double the 2 sheldons or do I double the existent 3 on the list?
Diego Mayer
@Chrono79
Nov 17 2017 20:48
if u have [A,B,C] (too lazy to write names on quotes /strings)
and wanna know the 1 whos turn to drink
[A,B,C], 1 should be A ... after A drinked its cola.. it moves to the end.. but doubling turn so becomes [B,C, A, A]
[A,B,C], 2 should be B ... cuz [B,C, A, A] <-- now is B turn (next in queue)
[A,B,C], 3 should be C ... cuz [C, A, A, B,B] <-- now is C turn (next in queue)
[A,B,C], 4 should be A ... cuz [ A, A, B, B, C, C] <-- now is A turn (next in queue)
[A,B,C], 5 should be A ... cuz [ A, B, B, C,C, A, A] <-- now is A turn (next in queue)
[A,B,C], 6 should be B ... cuz [ B, B, C, C, A, A, A, A] <-- now is B turn (next in queue)
and so on
you double each person that drinks a cola
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 20:50
yeah someone explained me it right now I got train my english tbh got a bit confused on the problem context but that's aswell @Chrono79
Diego Mayer
@Chrono79
Nov 17 2017 20:52
:+1:
Stephen James
@sjames1958gm
Nov 17 2017 20:52
@tiagocorreiaalmeida I am someone now :)
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 20:53
thanks*
sorry @sjames1958gm didnt figured you are on this room
:D
but makes sense since you knew the problem ahaha
Stephen James
@sjames1958gm
Nov 17 2017 20:53
@tiagocorreiaalmeida I am just kidding
Pieter Stokkink
@forkerino
Nov 17 2017 21:20
Oh wow, I see a lot of overly complex solutions to that kata.
Jason Luboff
@JLuboff
Nov 17 2017 21:21
I haven't even been able to try it.. each time I tried to just console.log the server timed out :joy:
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 21:27
I stopped for a while confused what im doing wrong at this point well tomorrow probably will look at it and solve it quick fast the usual
Pieter Stokkink
@forkerino
Nov 17 2017 21:32
@JLuboff Guess I got lucky, I just followed my intuition and wrote a line of code and after submitting it turned out I was very close.
Also went the recursive route
Jason Luboff
@JLuboff
Nov 17 2017 21:33
@forkerino eh it's working now. Just not coming up with a good solution heh
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 21:37
any soad fans here?just found a curious video
Jason Luboff
@JLuboff
Nov 17 2017 21:37
...syste mof a down..?
Tiago Correia
@tiagocorreiaalmeida
Nov 17 2017 21:37
there we go
Shiran
@shiranag
Nov 17 2017 22:17
@shiranag
hi guys i need help i worked on my website and i made form that some people can write user name and pass,email
how to get this elements to my mail ?
javascript
Shiran
@shiranag
Nov 17 2017 22:37
Kaz Baig
@kbaig
Nov 17 2017 22:38
@shiranag so either open their mail client or send the info to an endpoint on your server that sends the mail
:)
Shiran
@shiranag
Nov 17 2017 22:39
you can show my example
@shiranag so either open their mail client or send the info to an endpoint on your server that sends the mail
@kbaig
Kaz Baig
@kbaig
Nov 17 2017 22:54
@kbaig sorry what are you asking
Shiran
@shiranag
Nov 17 2017 22:55
@kbaig you can show me example
Kaz Baig
@kbaig
Nov 17 2017 22:56
@shiranag the top response in the stack overflow link has a good example
Shiran
@shiranag
Nov 17 2017 23:01
i am new in javascript and need more help
this is the code

<div>
<form id="contactForm" novalidate="">
<div class="form-item">
<label for="“name”">Name</label>
<input id="name" type="text" placeholder="Name" required=""/>
</div>
<div class="form-item">
<label for="“email”">Email Address</label>
<input id="email" type="email" placeholder="Email Address" required=""/>
</div>
<div class="form-item">
<label for="“phone”">Phone Number</label>
<input id="phone" type="tel" placeholder="Phone Number" required=""/>
</div>

    <button type="submit">Send</button>
  </form>

</div>

</section>

Shiran
@shiranag
Nov 17 2017 23:08
@kbaig this is the code need help
Moisés Man
@moigithub
Nov 17 2017 23:24

for that above :point_up: 17 de noviembre de 2017 18:01 u will need to have a backend server to handle form data

easier if u use some forwarding service
https://formspree.io/ (never used.. but seems easier to use)