Javascript
Last Updated: November 19, 2026
What Is JavaScript?
JavaScript (JS) is the programming language of the web. It runs in every major browser and, through Node.js, on servers. Brendan Eich created it at Netscape in 1995. Its official standard is called ECMAScript. In crypto, JavaScript and its typed cousin, TypeScript, run most wallet screens and dApp front ends, plus the code that links apps to blockchains.
How JavaScript Works
JavaScript can be written in several styles, from objects to small functions that can be reused. Modern engines turn the code into machine code while it runs, so even large apps stay fast. The language runs on one main thread. To avoid freezing the page, it hands slow jobs, such as waiting for a blockchain node to reply, to an event loop and picks up the result later.
JavaScript’s Use in Crypto
Most crypto apps people use in a browser are written in JavaScript or TypeScript. Developers use libraries such as ethers.js and viem to read balances, build transactions and talk to Ethereum nodes over RPC. The older web3.js library was shut down. ChainSafe announced on January 15, 2025 that it would archive web3.js on March 4, 2025, and pointed developers to ethers.js and viem.
JavaScript also reaches the protocol level. ethereum.org lists Lodestar, an Ethereum consensus client written in TypeScript. Smart contracts themselves are usually written in Solidity, and JavaScript code then calls them from the user’s screen.
Risks: npm Supply Chain Attacks
JavaScript projects use thousands of packages from the npm registry, and attackers target them. On December 2, 2024, compromised versions 1.95.6 and 1.95.7 of the @solana/web3.js library carried backdoor code built to steal private keys, according to the CNCF security catalog. A publisher account had been taken over through phishing, and the code stayed live for several hours.
On September 8, 2025, attackers phished the npm account of a well-known maintainer and published malicious versions of widely used packages such as chalk and debug. Security firm Endor Labs counted 25 affected packages. The code swapped crypto addresses inside browsers to redirect payments. Developers reduce the risk with lockfiles, pinned versions and audits, and users should confirm every address on a trusted device screen.
JavaScript vs TypeScript
TypeScript is JavaScript with types, released by Microsoft in 2012. Developers add type labels, such as “this value is an address,” and a compiler checks them before the code runs. The output is plain JavaScript, so browsers run it as usual. Popular crypto libraries, including viem and ethers.js, are written in TypeScript.
Why Crypto Apps Need BigInt
Token amounts are very large whole numbers. Ether has 18 decimal places, so 0.01 ETH is 10,000,000,000,000,000 wei. That is more than the largest whole number a normal JavaScript number can hold exactly, about 9 quadrillion. Above that limit, rounding errors could change an amount.
JavaScript added a BigInt type in the ECMAScript 2020 edition. It stores whole numbers of any size exactly. viem and version 6 of ethers.js use BigInt for token amounts. They also include helpers that turn wei into ether and back. Gas prices are often shown in gwei, one billionth of an ether, but contracts count in wei.
How the Language Is Updated
The TC39 committee at Ecma International maintains the ECMAScript standard. Since 2015, it has published a new edition each year, named after the year, such as ES2015 and ES2020. New features pass through several review stages before they are added. That gives browsers and Node.js time to support them.
Frequently Asked Questions
Why is JavaScript important in crypto?
Almost every crypto app people open in a browser is built with JavaScript or TypeScript. That includes wallet extensions, exchange dashboards and DeFi front ends. Libraries such as ethers.js and viem let that code read blockchain data and prepare transactions for the user to sign. Without JavaScript, most people would have no easy way to use blockchains from a web page.
Is web3.js still maintained?
No. ChainSafe announced on January 15, 2025 that it would sunset web3.js and archive the libraries on March 4, 2025. The company told developers to move to ethers.js or viem and published guides for both. Older apps may still run on web3.js, but they no longer receive updates, so teams usually plan a move to a maintained library.
Can a JavaScript package steal crypto?
Yes, if it is compromised. In December 2024, two versions of the @solana/web3.js library contained code that tried to steal private keys, and in September 2025 hijacked npm packages swapped wallet addresses in browsers. Developers protect users by pinning trusted versions and reviewing updates, while users should double check addresses and transaction details before signing.
Why do crypto apps use BigInt in JavaScript?
Because token amounts are stored as very large whole numbers. Ether uses 18 decimal places, so 0.01 ETH is 10,000,000,000,000,000 wei. That is larger than the biggest whole number a normal JavaScript number holds exactly, about 9 quadrillion. BigInt, added in ECMAScript 2020, keeps such values exact, which is why libraries like viem use it.
Data sources: ChainSafe blog (January 15, 2025), CNCF TAG Security compromise catalog (@solana/web3.js, December 2024), Endor Labs report on the September 2025 npm attack, ethereum.org nodes and clients page (updated October 29, 2026), Ecma International ECMA-262 and TC39 process documents, viem and ethers.js documentation, read November 19, 2026.