Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 08:18
    FieryCod commented #1379
  • Jan 30 10:01
    atif089 commented #1379
  • Jan 30 10:01
    atif089 commented #1379
  • Jan 30 10:01
    atif089 commented #1379
  • Jan 30 04:11
    tclindner opened #1998
  • Jan 28 05:21

    ljharb on master

    [eslint config] [base] [patch] … [eslint config] [patch] extend … Merge pull request #1996 from r… (compare)

  • Jan 28 05:21
    ljharb closed #1996
  • Jan 28 04:50
    ljharb synchronize #1996
  • Jan 27 21:45
    ljharb closed #1997
  • Jan 27 21:45

    ljharb on master

    [editorial] [react] fix typo [eslint config] [*] [deps] upda… (compare)

  • Jan 27 21:39
    ljharb synchronize #1997
  • Jan 27 21:39
    ljharb labeled #1997
  • Jan 27 21:39
    ljharb labeled #1997
  • Jan 26 18:14
    ljharb labeled #1996
  • Jan 26 18:14
    ljharb labeled #1996
  • Jan 26 18:13
    ljharb synchronize #1996
  • Jan 26 18:05
    ljharb commented #1996
  • Jan 26 08:55
    telmen opened #1997
  • Jan 24 19:37
    peteclark3 commented #1689
  • Jan 24 17:25
    ljharb commented #747
1point7point4
@1point7point4
it's called callbacks
they're pretty good, you should try them sometime
if you don't like those you can try promises or tasks
promises are more popular but they're for normies
Jordan Harband
@ljharb
@danstos async/await is just promises
you must know how they work to use await properly.
and you can definitely shim promises in IE
wly
@ahkjxy
async/await shim?
async/await shim for IE?
1point7point4
@1point7point4
@DanStos use a polyfill
1point7point4
@1point7point4
Does anyone know of a good place that actually is for discussing JS in general?
jsx
@riverspirit
@1point7point4, try the ##javascript channel on freenode.
Jordan Harband
@ljharb
@ahkjxy you can’t shim syntax, you’d use Babel to transpile it. But the Airbnb guide doesn’t let you do that for async/await because the transpile version is too heavyweight
pseduo-god
@pseudo-god
This message was deleted
markdavis23
@markdavis23
Hat.sh | Online file encryption using the WebCryptoAPI
https://github.com/sh-dv/hat.sh
Miles D
@white-room
is there a consensus on factory function naming? #23.7 says to use camelCase when exporting single functions and #23.8 about PascalCase does not mention factories, so i would assume camelCase. also, what's the preferred naming convention for factory factions? createSomething / makeSomething / somethingFactory / etc?
Jordan Harband
@ljharb
yes, factory functions would be camelCase
there's no preferred convention, use whatever makes the most sense for your use case
ajay yadav
@ajay7868

can any one help this one

Write a program that takes two strings as input and outputs two numbers, n1 and n2.
The output values indicate a degree of matching between the two strings:

n1 : number of letters in one string that each match in value and
in position to a letter in the other string.

n2 : number of letters in one string that each match in value,
but not in position to a letter in the other string.

Some notes:

  • the output should be the same if the two strings were swapped
  • each letter instance in a string may only participate in one match.
  • if a letter instance can participate in either n1 or n2, it is to be counted towards n1.
  • the two strings may or may not be of the same length.

Some examples (str1, str2 -> n1,n2):

"abc", "abc" -> 3,0
"bca", "abc" -> 0,3
"aab", "abb" -> 2,0
"aab", "aba" -> 1,2
"abc", "aaa" -> 1,0

1point7point4
@1point7point4
@ajay7868 use Haskell.
Maximiliano Tulian
@maximilianotulian
Hello guys, is there any rule for this chat?
hope you're having a great day
With rule, I'm referring to a policy about what do to, what not do, etc
Eric Bruno
@enz54
yes be polite , of course and I believe posting relevant issues. I dont think someone will have time to answer a question about java or c#. try to be as clear and specific as possible :-)
Maximiliano Tulian
@maximilianotulian
perfect, thanks Eric
Eric Bruno
@enz54
no worries @maximilianotulian
liyunhua520
@jzylyh
hi
liyunhua520
@jzylyh
...
Muhammad
@MuhammadJamaluddin
What's the convention regarding PropTypes for a required array of objects where the objects are not of a consistent structure?
Muhammad
@MuhammadJamaluddin
Also, regarding the (react/no-array-index-key) rule, what should I do if my objects don't have an id or any unique field for that matter?
Jordan Harband
@ljharb
when would an array not have a consistent structure across its items?
as for the key rule, certainly when there’s nothing unique about each item, you have to override that rule and just use the index, but also when would you have nothing unique about the items?
Muhammad
@MuhammadJamaluddin

Now that you asked, I think that yes the objects are consistent, but one situation where you could have inconsistent structure is if you're using MongoDB, so the objects could have different properties.

This is an excerpt of the array. Not sure if any of theses properties would considered to be unique.

{"events": [
  {"date": "-300", "description": "Pilgrims travel to the healing temples of Asclepieion to be cured of their ills. After a ritual purification the followers bring offerings or sacrifices.", "lang": "en", "category1": "By place", "category2": "Greece", "granularity": "year"}, 
  {"date": "-300", "description": "Pyrrhus, the King of Epirus, is taken as a hostage to Egypt after the Battle of Ipsus and makes a diplomatic marriage with the princess Antigone, daughter of Ptolemy and Berenice.", "lang": "en", "category1": "By place", "category2": "Egypt", "granularity": "year"}, ]}
Muhammad
@MuhammadJamaluddin
I get these two elsint errors when I try to attach an event handler on the tbody element:
Visible, non-interactive elements with click handlers must have at least one keyboard listener.eslint(jsx-a11y/click-events-have-key-events)

Non-interactive elements should not be assigned mouse or keyboard event listeners.eslint(jsx-a11y/no-noninteractive-element-interactions)
<tbody onClick={score}>
      <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
      </tr>
// ... other rows
I'm simply trying to build a telephone keypad-style UI that enables the user to choose a score
What is the recommended solution here?
BTW, that my score function:
const score = (event) => {
  console.log(event.target.innerHTML);
};
& it works as expected (it grabs the score of whatever clicked cell/td)...
Jordan Harband
@ljharb
either override the rule or put the onClick on each td
react is using delegation internally so you don’t have to worry about it.
Muhammad
@MuhammadJamaluddin
Yeah, I think overriding the rule would be easier in this case. Thanks @ljharb
Muhammad
@MuhammadJamaluddin
Has the eslint-plugin-react-hooks been incorporated into Airbnb's eslint configuration yet?
Jordan Harband
@ljharb
no
Chris Cullen
@123xylem
    for( var i = 0; i < arr.length; i++){
       var next = arr[(i+1)%len];

         diff = (values[arr[i]] - next );
          console.log(next);
          date += values[arr[i]];
        }
Why is next here going back to the start of the array once its finished?
how can I make it end at the end
RAHUL KOUNDAL
@rahulkoundal
hello everyone
i have to read the name of the sheet of the excel file
how i can do ?