Skip to main content
1 vote
2 answers
177 views

Apologize upfront, I am very new to JS. Having trouble finding out where I should put the arrow function here for this question. I've tried putting it in the parameters when I call the function but ...
0 votes
4 answers
4k views

I am writing a function that needs to determine how many arguments have been passed to itself. I am able to get this information after a function has been declared, but whenever I call it from within ...
84 votes
10 answers
32k views

I've read in several places that the key difference is that this is lexically bound in arrow functions. That's all well and good, but I don't actually know what that means. I know it means it's unique ...
55 votes
2 answers
13k views

(() => console.log(arguments))(1,2,3); // Chrome, FF, Node give "1,2,3" // Babel gives "arguments is not defined" from parent scope According to Babel (and from what I can ...
0 votes
1 answer
275 views

I'm wondering why the following arrow function, named 'countArg2' doesn't work. Is there anybody can explain what's wrong please? This works function countArg1() { return arguments.length; } ...
0 votes
1 answer
74 views

How do you convert the following arrow function expression to a regular one? rootRef.on('child_removed', snapshot => { console.log('Child(s) removed'); B4A.CallSub('onchild_removed',true,&...
39 votes
4 answers
18k views

How do you write a PHP arrow function with multiple line expressions? JavaScript one-liner example: const dob = (age) => 2021 - age; PHP one-liner equivalent: $dob = fn($age) => 2021 - $age; ...
-2 votes
1 answer
67 views

I'm trying to use JavaScript's map function to extract names from an array of objects. I expected it to return an array of names like ["Alice", "Bob", "Charlie"], but it ...
8 votes
2 answers
6k views

While learning JS and React I've come across confusing differences in tutorials. I'll split the questions below with examples. I understand bind for regular functions and this context, it's just arrow ...
6 votes
3 answers
4k views

Ok, I have the following scenario: type IHashFn = (arg: string) => number; const hash: IHashFn = (arg) => { return 42; } So far, so good. Now I want the function to be generic. const hash: &...
0 votes
1 answer
2k views

Calling a callback function to get values and render it in onDownload: (buildHead, buildBody, columns, data) => { if (this.state.isexceldownload) { this.callbackMethod((d) =&...
263 votes
8 answers
131k views

I have a function that I am trying to convert to the new arrow syntax in ES6. It is a named function: function sayHello(name) { console.log(name + ' says hello'); } Is there a way to give it a ...
0 votes
2 answers
303 views

I am merging a folder 250 of large .txt files each approximately 1GB and over 6 million rows. I'm merging this folder with another .txt file outside of this folder that is also 1GB based on a common ...
1 vote
1 answer
352 views

I have a large dataset of over 43 million rows and 3.84 GB and another dataset of over 6000 rows and 459 KB. I am trying to do an inner_join() based on two columns: One exact column based on a common ...
0 votes
4 answers
86 views

I have a JavaScript object that's defined like this: const test = { myFirstFunction: () => { console.log('MyFirstFunction called'); this.mySecondFunction('data'); }, ...

15 30 50 per page
1
2 3 4 5
102