Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 JAVASCRIPT


  The four key figures behind the success of JavaScript - Douglas Crockford

JavaScript's success can be attributed to at least four key figures:Brendan Eich, the creator of JavaScriptDouglas Crockford, the creator of JSLint and JSONJohn Resig, the creator of jQueryRyan Dahl, the creator of Node.js.We are already very familiar with Brendan Eich and the invention process of JavaScript, so let's start with Douglas Crockford, the second in command of JavaScript.AllianceIn the 1990s, Microsoft's dominance overshadowed the whole world.At this time, two challengers emerged, one was the IT giant Sun, and the other was the IT upstart Netscape.Sun believed that Java programs co...

1,556 0       JAVASCRIPT HISTORY DOUGLAS CROCKFORD


  JavaScript's New Features: Exploring the Latest Additions to the Language

As the web continues to evolve, so too does the JavaScript ecosystem. With the release of ECMAScript 2023 (ES2023), JavaScript developers can now leverage a range of new features that promise to improve code quality, readability, and maintainability. In this blog post, we'll dive into some of ES2023's most exciting additions and provide practical examples of how they can be used in your projects.1. Private Fields and Methods in ClassesOne of the most anticipated features in ES2023 is the introduction of private fields and methods in classes. These enable developers to encapsulate internal clas...

1,078 0       ES2023 JAVASCRIPT


  Understanding JavaScript closure and where it can be used

ClosureThe official definition of closure is: an expression (usually a function) that has many variables and is bound to an environment that includes those variables.In JavaScript, closure refers to the ability of a function to access the lexical scope in which it was defined, even after the function has been executed and left that scope. This ability is due to the fact that when a function is created, it generates a closure that includes a reference to the definition environment of the current function, allowing the function to continue to access those variables within that environment.Below ...

1,151 0       JAVASCRIPT USAGE CLOSURE


  Let's talk about JavaScript deep clone

In JavaScript, deep clone means creating a brand new object that includes all nested objects, with all properties being completely independent copies. This is different from shallow copying, which only copies the first-level properties, with nested objects being referenced rather than copied.There are multiple ways to perform deep copying in JavaScript, but the best one to use depends on the specific use case.Can use JSON.parse & JSON.stringify? ❌JSON.parse(JSON.stringify(obj)) is a depth cloning method that uses JSON serialization to create an object. It works for objects that do not co...

3,198 0       JAVASCRIPT DEEP CLONE


  Mastering Async/Await in JavaScript: A Comprehensive Guide with Examples

As a veteran JavaScript developer, I have seen the evolution of JavaScript's asynchronous programming landscape. From callbacks to promises and now async/await, JavaScript has come a long way in making it easier to handle asynchronous operations in a clean and readable manner.In this article, we will delve into the world of async/await and explore why it has become a popular choice for handling asynchronous operations in JavaScript. We will cover the basics of async/await, its syntax, and how it differs from traditional promises. Additionally, we will go through several examples of using async...

1,537 0       JAVASCRIPT COMPARISON PROMISE ASYNC AWAIT


  Start to work with rollup.js to pack JS files

rollup.js is a module bundler for JavaScript. It compiles small piece of JavaScript modules spreading in different files into a single larger standardized ES code file. This post will show some entry level usage for this library.IntroductionNormally a bundler tool would compile a few small JavaScript files into a single JavaScript so that web browser can read, parse and render it properly. A bundler tool may be needed because of a few reasons:Some early stage browsers don't understand modules, the modularized JS codes need to be packed into standard JS code so that browser can understandThe mo...

1,645 0       WEBPACK BUNDLE ES MODULE COMMONJS ROLLUP.JS


  Why Math.min() > Math.max() is true in JavaScript

...

5,767 2       MATH.MAX() MATH.MIN() JAVASCRIPT COMPARISON


  Some frequently used ES6 code snippets

Below are a list of ES6 code snippets which are used frequently. Hope that it will be helpful.1. Shuffle array elementslet arr = [67, true, false, '55']arr = arr.sort(() => 0.5 - Math.random())console.log(arr)// [ '55', 67, false, true ]2. Remove characters which are not numbersconst str = 'xieyezi 23213 is 95994 so hansome 223333'const numbers = str.replace(/\D/g, '')console.log(numbers)// 23213959942233333. Reverse sequence or wordsconst sentence = 'xieyezi js so handsome, lol.'const reverseSentence = reverseBySeparator(sentence, "")console.log(reverseSentence);// .lol ,emosdnah os sj ize...

1,421 0       JAVASCRIPT TIPS CODE SNIPPET ES6