1,530 questions
1 vote
2 answers
177 views
Question: Call the function and passing in an anonymous arrow function that alerts the spliced value
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
Why am I unable to use arguments.length in an arrow function?
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
What does "this" refer to in arrow functions in ES6?
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
Official information on `arguments` in ES6 Arrow functions?
(() => 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
Why this arrow function doesn't work with 'arguments.length'? [duplicate]
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 to convert an arrow function expression into an equivalent ordinary (old-style) function expression?
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 to write multiple expressions in PHP arrow functions
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
Why does JavaScript map() return undefined without return in arrow function? [duplicate]
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
Classes and arrow functions and THIS [closed]
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
Typescript: generic functional type/interface for arrow function
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
mui-datatables onDownload function giving undefined
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
How do I write a named arrow function in ES2015?
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
Working with a folder of large .txt files using Arrow, Duckdb, and Future
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
Fuzzy and exact matching using Arrow and Duckdb R
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
JavaScript - Object Functions [duplicate]
I have a JavaScript object that's defined like this: const test = { myFirstFunction: () => { console.log('MyFirstFunction called'); this.mySecondFunction('data'); }, ...