How is a functional programming-based JavaScript app laid out?

You should read this question: Javascript as a functional language There are lots of useful links, including: Use functional programming techniques to write elegant JavaScript The Little JavaScripter Higher-Order JavaScript Eloquent JavaScript, Chapter 6: Functional Programming Now, for my opinion. A lot of people misunderstand JavaScript, possibly because its syntax looks like most other programming … Read more

Next.js return the 404 error page in getInitialProps

Next v10 allows to return 404 page (not with props, but just plain as it is below) if (!checkItem) { return { notFound: true } } Full code that works for me: ✅✅✅ export const getServerSideProps = wrapper.getServerSideProps(async ({ req, res, locale, query, store }) => { const { productId, categoryId } = query const … Read more

Using a .NET DLL in Node.js / serverside javascript

Check out the edge.js project I started (http://tjanczuk.github.com/edge). It provides a mechanism for running .NET and node.js code in-process. Edge.js allows you to call .NET code from node.js and node.js code from .NET. It marshals data between .NET and node.js as well as reconciles the threading models between multi-threaded CLR and single threaded V8. Using … Read more

Why and when to use Node.js? [duplicate]

It’s evented asynchronous non-blocking I/O build ontop of V8. So we have all the performance gain of V8 which is the Google JavaScript interpreter. Since the JavaScript performance race hasn’t ended yet, you can expect Google to constantly update performance on V8 (for free). We have non-blocking I/O which is simply the correct way to … Read more

What is non-blocking or asynchronous I/O in Node.js?

Synchronous vs Asynchronous Synchronous execution usually refers to code executing in sequence. Asynchronous execution refers to execution that doesn’t run in the sequence it appears in the code. In the following example, the synchronous operation causes the alerts to fire in sequence. In the async operation, while alert(2) appears to execute second, it doesn’t. Synchronous: … Read more