Questions tagged [javascript]
JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, weakly-typed language used for both client-side and server-side scripting. Use this tag for questions regarding common implementations of ECMAScript, JavaScript, JScript, etc. JS does not typically refer to its ECMA-cousin, ActionScript.
2,127 questions
-4 votes
3 answers
253 views
Optimizing a "Transfer-Encoding: chunked" parser [closed]
I have written a parser for Transfer-Encoding: chunked requests over HTTP/1.1. Now I'm working on optimizing the code. This is the specification 7.1. Chunked Transfer Coding. The first optimization ...
3 votes
3 answers
233 views
Best Practices for Implementing a Heartbeat Feature in a Laravel App to Track Offline Status
I'm trying to implement a heartbeat feature for offline tracking that just sends an offline message to the server once the web browser app (Laravel-based) is offline. Ideally it will ping the app's ...
3 votes
3 answers
193 views
Why does the collection library for Dart use a bit mask for hashing collections?
I was implementing a hashing function for a class and I took a minute to look at the first-party collection package for Dart to see how they implemented their hashing function for collections. They ...
1 vote
4 answers
355 views
Synchronized Web Audio Playback on Multiple Smartphones Using Timestamped Chunks and Manual Time Shifting
Note: I am not super knowledgeable web javascript or streaming, but I have read this and this and this I am proposing an alternate idea and just trying to verify whether I have a sound starting point ...
2 votes
1 answer
515 views
Unit testing a Web Worker in JavaScript/TypeScript - Best Practice
I got assigned with writing unit tests for a class that instantiate a Worker inside in it's constructor. The code looks simmilar to this, class SomeClass { private _worker: Worker; constructor(...
0 votes
2 answers
271 views
How can I write more optimal code keeping Javascript "shapes"/"hidden classes" in mind?
All optimising Javascript runtimes use "shapes" (SpiderMonkey term) or "hidden classes" so that instead of objects being treated as the dictionaries or hashmaps they can instead be ...
4 votes
5 answers
625 views
Is changing the signature of a callback a breaking change?
In Javascript, should appending to the signature of a callback be considered a breaking change? I.e. given an operation op(target, callback) should changing it from callback(item, index, array) to ...
-2 votes
1 answer
365 views
What is the best way to cache paginated data when any page can be moved to and page size is changeable?
I have a React Redux web app that fetches data from an Express/Node backend and MySQL database. I have a table of records that I fetch and store in redux as an array of objects, which I display as a ...