Issue #496 (Object.is(), JS Libs, JSON/DB, Vue)01/19/23
You likely know of two ways to compare values in JavaScript:
- Double-equals (AKA "loose equality", which performs type conversion) which uses the syntax: var1 == var2
- Triple-equals (AKA "strict equality", which doesn't convert types), which looks like: var1 === var2
These are common and will both continue to be used, though most people will recommend tripe-equals for less error-prone results. But there's a third way to do equality comparison: the Object.is() method.
Simply put, Object.is() accepts two parameters and returns a Boolean indicating whether the two values are the same value. Here are a few simple examples:
console.log(Object.is('myString', 'myString')); // true
console.log(Object.is(73, '73')); // false
console.log(Object.is('29', '29')); // true
|
As you can see, Object.is() behaves almost exactly like triple-equals, not coercing types (i.e. the second example above would return true using a double-equals comparison).
The only small difference between Object.is() and triple-equals is how each of them treats +0, -0, and NaN values, as shown below:
console.log(-0 === +0); // true
console.log(-0 === -0); // true
console.log(NaN === NaN); // false
console.log(Object.is(-0, +0)); // false
console.log(Object.is(-0, -0)); // true
console.log(Object.is(NaN, NaN)); // true
|
Notice how triple-equals considers -0 to be the same value as +0 but Object.is() sees them as different. Likewise, while NaN is apparently not equal to itself using triple-equals, it is correctly seen as the same value when using Object.is().
You can fiddle around with all the above examples in this CodePen, which also includes a bunch of other comparisons, to give you an idea of how this method compares to triple-equals.
All-in-all, I don't personally see much practical use in preferring Object.is() over triple-equals. I suppose it does have somewhat of a cleaner look in your code and might amount to being easier to read and maintain in the future.
Now on to this week's tools!
|
JavaScript Libraries and Frameworks
Measure the Success of Your Components 📊
Hot out the oven! Omlet is a code-based component analytics product to help frontend dev teams drive component adoption, make confident updates, and prove the value of your design system. SPONSORED
Gluon
A framework for creating desktop apps from websites, using system installed browsers and Node.js.
gpu-io
A WebGL-based, GPU-accelerated computing library for creating real-time physics simulations, general purpose GPU computations, and other mathematical calculations.
Civet
A new modern way to write TypeScript that uses concise syntax for faster coding. Includes a playground and lots of examples.
n8n
A free "fair-code" licensed workflow automation tool to easily automate tasks across different services.
Bay.js
An easy-to-use, lightweight library for web-components that uses standard string literal syntax and updates only the parts of the HTNL that have changed.
ethers
A simple, compact and complete library for developing Ethereum apps, for interacting with the Ethereum Blockchain and its ecosystem.
Formidable
A Laravel-inspired framework that makes it easy to build full-stack or API applications by providing a great developer-first experience.
mojo.js
A real-time web framework for Node.js, written in TypeScript and designed for hypermedia-driven backend web services using all the latest JavaScript features.
Zarf
A fast, Bun-first web API framework with full Typescript support.
InboxSDK
A high-level JavaScript library used to easily build browser extensions that interact with Gmail.
Openblocks
An open-source solution for building internal tools that includes 50+ built-in components, native database connections, and lots more features.
|
|
JSON Tools, Databases, etc.
Skyflow: What If Privacy Had an API?
What are the most common mistakes companies make when it comes to managing and protecting sensitive user data? Read the guide now to learn how to move fast without breaking privacy. SPONSORED
DummyJSON
A REST API that provides access to fake JSON data as placeholder content, with a number of different categories of content (products, e-carts, users, posts, comments, etc).
graphql-sse
A zero-dependency, HTTP/1-safe, simple, GraphQL over Server-Sent Events Protocol server and client.
JSON Formatter
A Chrome extension that auto-formats JSON when you view it in a browser tab.
QueryJar
A Chrome extension that works as an SQL assistant, enable you to easily search for the exact query you need.
GreptimeDB
An open-source Time Series Database (TSDB), written in Rust, and built for increased scalability, high performance, and efficiency.
Saleor
An open-source, GraphQL-first e-commerce platform delivering ultra-fast, dynamic and personalized shopping experiences.
|
Trevor
A service that enables your team members to get answers from your database, even if they don't know SQL. Offers a good free plan.
schema-fixer
A Node.js library to fix arbitrary data (e.g. databases, forms) that's not in a preferred format.
sql.js-httpvfs
A fork of and wrapper around sql.js to provide a read-only HTTP-Range-request based virtual file system for SQLite, for hosting read-only SQLite databases on static file hosts like GitHub Pages.
|
Vue Tools
Skyflow: What If Privacy Had an API?
What are the most common mistakes companies make when it comes to managing and protecting sensitive user data? Read the guide now to learn how to move fast without breaking privacy. SPONSORED
Vue3 Canvas Video Player
A video player for Vue 3 that uses canvas and includes a number of props to customize the look and functionality.
vue-safe-teleport
Vue component that converts Vue's teleport feature to safe teleport, recommended for teleporting inside your app.
pinceau
In early development. A zero-runtime CSS-in-TS framework made for Vue and built to feel like a native Vue feature.
Temir
A Vue library for interactive CLI apps that provides the same component-based UI building experience that Vue offers in the browser.
vue-command-palette
A fast, composable, unstyled command palette interface for Vue, with access via CMD-K or by another custom key combo.
Lotion
An open-source Notion UI built with Vue 3 that includes a block-based editor, Markdown parsing, read-only mode, and more.
fluent-vue
An Internationalization plugin for Vue.js, based on Fluent.js, a JavaScript implementation of Mozilla's Project Fluent.
Nuxt Ionic
Still a work in progress. A batteries-included, zero-config Ionic integration for Nuxt.js-based projects.
On the Release Radar:
|
Commercial Apps and Classifieds
These are commercial apps, affiliate links, PPC ads, and paid classifieds. Submit yours!
|
AI Query – Generate error-free SQL in seconds, even with little knowledge of SQL syntax.
|
|
Email to JSON – Forward from any email account and get access to the JSON equivalent via webhooks/API.
|
|
Bright Data – Turn websites
into structured data via the world’s #1 web data platform.
|
|
Vertex – Get up and running in seconds with an instant API, authentication, and SQL access.
|
Raw Query – State-of-the-art AI to let you chat with your database like you do with teammates.
|
|
|
|
A Tweet for Thought
If you've been coding for a long time, you might relate to the progress represented in this graph.
Send Me Your Tools!
Made something? Send links via Direct Message on Twitter @WebToolsWeekly (details here). No tutorials or articles, please. If you have any suggestions for improvement or corrections, feel free to reply to this email.
Before I Go...
Music Historian lets you search and filter through last.fm's top 30,000 artists of all time and play the top track for every artist. I like that you can filter by "decade" and "popularity", which can help you find some more obscure stuff.
Thanks to all for subscribing and reading!
Keep tooling,
Louis
webtoolsweekly.com
@LouisLazaris
|
|