1
vote
3answers
38 views

Alert of vars returns “length” or “item”

I have a 16x16 table, and I asign a lambda function (to pass parameters to the actually functional function) to all the td like that: function handlerAsignment() { var trs = ...
0
votes
0answers
51 views

Asynchronous (setTimeout) lambda doesn't use correct inputs [duplicate]

I got the below code within a callback of xmlHTTPRequest callback function: // some more code before ... // schedule the UI update var totSteps = 6; for(var i = 0; i < listChangeEl.length; ++i) { ...
5
votes
2answers
1k views

Using arrow functions in TypeScript: how to make them class methods?

I'm fairly experienced programming but quite new to TypeScript. Trying to use it with jQuery and immediately ran into the 'this' issue with callbacks (such as $(document).ready. Using $.proxy() is ...
0
votes
1answer
112 views

How can I pass a variable into a lambda function? Dynamic Lambda functions

In the last line, how can I ensure that the "this" i'm referring to is the instantiated k8rModal object and NOT the object running the function? For other items in the future I'll need to dynamically ...
0
votes
0answers
164 views

Handling OData any() operation using JavaScript

I am handling OData filtering by converting filters to JavaScript expressions and evaluating them against my Data. All is well so far where I had flat Data Structures. Now, I am having a collection ...
0
votes
3answers
157 views

Eliminate duplicate code re: lambda loop parameter passing

Problem An array defines these elements: var equipment = new Array( "bakeware", "cookware", "kitchenware", "utensils" ); A function exists that associates these equipment types with editable ...
3
votes
5answers
3k views

How to kick-ass pass scope through “setInterval”

I'm currently wondering if there is a better solution than passing this scope to the lambda-function via the parameter 'e' and then passing it to 'funkyFunction' using call()-method ...
2
votes
2answers
148 views

JS λ-functions & “upper context” variables

Say I have some context where variables are set and a λ-function is called which uses them directly: function outerContext(){ ... var data = ...; // some data the script uses ... ...
1
vote
6answers
529 views

How do I pass argument to anonymous Javascript function?

I am writing a simple counter, and I would like to make installation of this counter very simple for users. One of the simplest counter code (for users who install it) I ever see was Google Analytics ...