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 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
  • Apr 01 18:02
    thecodingaviator commented #31059
Jason Luboff
@JLuboff
Its a shorthand method for functions
korzo
@korzo
@junipberry It's more-less shortcut for old function syntax with few exceptions
Jason Luboff
@JLuboff
It essentially eleminates the need for the word function
korzo
@korzo
@JLuboff I would not say eliminates. There are cases when old syntax is beneficial
Manish Giri
@Manish-Giri
@JLuboff :wave:
Jason Luboff
@JLuboff
@korzo Correct, in the cases where you use it, thats basically what it does is gets rid of function
@Manish-Giri Manish my firend, how are you?
Manish Giri
@Manish-Giri
@JLuboff recovering from the flu
ugh
Jason Luboff
@JLuboff
That sucks
Manish Giri
@Manish-Giri
how're you
Jason Luboff
@JLuboff
Not bad...just waiting for the day to be over
Manish Giri
@Manish-Giri
yea
nice
ooh maybe you can help me with my question @JLuboff
Jason Luboff
@JLuboff
Half-assly working on my Book (game) trading app
Perhaps I can..
Manish Giri
@Manish-Giri
@JLuboff so I have an input string, and I need to make sure it passes some criteria, like it should have at least one character, should have both letters & numbers, shouldn't have _, etc.
Jason Luboff
@JLuboff
Alright..so form validation?
Manish Giri
@Manish-Giri
but the problem is, I don't know of a way to do something like ! in regex, you know?
like with regular loops, you could do - if (element !== '\s')
Jason Luboff
@JLuboff
How are you testing?
Manish Giri
@Manish-Giri
but if you do /\S/, it matches a whole world of other characters that aren't whitespaces
it's for a codewars kata, lol
Jason Luboff
@JLuboff
You could always do if(!string.test(regex))
Oh gotcha
Manish Giri
@Manish-Giri
right but then I'd need multiple regexes?
if(string.test(r1) && !string.test(r2))
Jason Luboff
@JLuboff
Hmmm..possibly..
Manish Giri
@Manish-Giri
Screenshot 2017-09-07 19.29.34.png
@JLuboff that looks like it works, but I can't think coz of the flu, ugh
@JLuboff ty
CamperBot
@camperbot
manish-giri sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:star2: 2187 | @jluboff |http://www.freecodecamp.com/jluboff
Jason Luboff
@JLuboff
my syntax was wrong... should be regex.test(string)
Manish Giri
@Manish-Giri
worked
Jason Luboff
@JLuboff
:+1:
Manish Giri
@Manish-Giri
Screenshot 2017-09-07 19.34.37.png
Jason Luboff
@JLuboff
const alphanumeric = s => { /[A-Za-z\d]+/.test(s) && !/[\s*_!]/.test(s)
Manish Giri
@Manish-Giri
damn ppl have solved it with just one .test
Jason Luboff
@JLuboff
I believe it. My regex aint that strong though so I wouldn't be able to
Manish Giri
@Manish-Giri
s => /^[a-z\d]+$/i.test(s);
so this
Andrew Kay
@andrewjkay
Does anyone know of a way to get around a No 'Access-Control-Allow-Origin' header is present error? Trying to query an API from vanilla JS, don't want to have to use jquery or implement a back end
Jason Luboff
@JLuboff
@Manish-Giri Ya I'd have to look all that up to see what it does lol
Manish Giri
@Manish-Giri
I think this bit - ^[a-z\d]+ - matches start of the input
and this matches the end - [a-z\d]+$
since it doesn't leave scope for anything else in between
maybe that's why it passes?
@JLuboff