Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
WinJS Promises and JQuery Promises are the same thing?
Promises are a programming pattern for dealing with asynchronous operations. The pattern could be applied to other languages, but they are most commonly encountered in JS libraries (like jQuery and WinJS).
Kraig Brockschmidt has a really good blog post about how they work (in general) and in WinJS here:
http://blogs.msdn.com/b/windowsappdev/archive/2013/06/11/all-about-promises-for-windows-store-apps-written-in-javascript.aspx
I've written a blog post comparing jQuery promises and promises in WinJS. The short answer: they're interoperable.
http://blogs.windows.com/windows/b/appbuilder/archive/2013/07/10/jquery-and-winjs-working-together-in-windows-store-apps.aspx
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
One pretty big issue I've run into with JS is that it has no in built in priority queue unlike Java or Python (heapq).
I was just wondering in an interview situation, could you propose below solution and essentially 'pretend' that JS does indeed have a native Priority Queue structure:
https://leetcode.com/problems/merge-k-sorted-lists/discuss/10528/A-java-solution-based-on-Priority-Queue
Only asking because implementing a MinHeap is pretty complicated and not sure if I'll able to do it in a high stress environment.
I think it's fair to assume you can use an npm library to make JavaScript have capabilities comparable to other languages.
Google Closure Library has some useful structures implemented in JavaScript.
You can find goog.structs.PriorityQueue here.
Facebook similarly has fbjs.
You can find their Heap implementation here.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Sorry I am a noob and a very beginner with Javascript and NodeJS. :(
Pardon me for asking this silly question.
So I am here a little bit confused. I searched a lot but didn't get the appropriate understanding. My question is simple:
Javascript is synchronous and we use async/await for the callbacks.
Nodejs is asynchronous but also then we use async/await nodejs also.
I really don't get this. How's is it happening? Maybe someone can give me a clear picture of this with some proper and easy to understand examples.
Thanks!
Javascript and Nodejs, code written in both works synchronously. Based on functional requirement we make the execution of code asynchronous by adding async/await.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I often hear something like "working knowledge of asynchronous programming" regards JavaScript in job descriptions etc, but I'm not sure what it mean - is it about callbacks and promises or is there something else to it? I'd appreciate if someone could explain this to me.
Yes, effectively. More generally, it's about understanding the asynchronous nature of the most common JavaScript environments (web browsers, Node.js) and being fully versed in using callbacks, promises, async/await (in modern environments), etc. Understanding the closures-in-loops problem, why you can't return the result from an asynchronous call, that code that looks like it's below other code in a function may run earlier than the code apparently above it (because the code above it is in a callback), etc.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
The problem is :
My friend told me that it is not JS framework. Is he right ? I've tried to collect evidences on the Internet to prove that it is a JS framework.
Yes.AngularJS is a Javascript structural front-end framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. Angular's data binding and dependency injection eliminate much of the code you would otherwise have to write.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I'm new to NodeJs and to JS actually. I coded my first application using callbacks everywhere and I reached a state where I couldn't handle the number of nested callbacks anymore (callback hell). So I searched for solutions and I read that Promises are one of the best ways to solve this problem. Btw, here's a good explanation for those who are interested: https://blog.risingstack.com/node-js-async-best-practices-avoiding-callback-hell-node-js-at-scale/
Therefore, I made a refactoring in the most critical functions using Promises and it works very well. However, I don't know if I should refactor all the application. How do JS developers do nowadays? Do they use Promises everywhere or do they keep using callbacks the most part of the time and use Promises only when there are too many nested callbacks? Is there a best practice for that?