惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
J
Java Code Geeks
博客园_首页
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
Intezer
P
Palo Alto Networks Blog
V
Vulnerabilities – Threatpost
雷峰网
雷峰网
O
OpenAI News
SecWiki News
SecWiki News
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
N
News | PayPal Newsroom
Project Zero
Project Zero
Forbes - Security
Forbes - Security
IT之家
IT之家
A
Arctic Wolf
WordPress大学
WordPress大学
Jina AI
Jina AI
T
Tor Project blog
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
博客园 - 聂微东
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Privacy International News Feed
Cloudbric
Cloudbric
G
GRAHAM CLULEY
博客园 - 叶小钗
H
Hacker News: Front Page
腾讯CDC
量子位
Help Net Security
Help Net Security
人人都是产品经理
人人都是产品经理
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
爱范儿
爱范儿
L
Lohrmann on Cybersecurity
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recorded Future
Recorded Future
C
CERT Recently Published Vulnerability Notes

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
What is JavaScript? The Honest Beginner's Guide to How It Actually Works
ilyas Elaissi · 2026-06-28 · via DEV Community

JavaScript runs on something like 98% of websites you visited today, and every modern browser ships with an engine built specifically to execute it. That is the short version. The longer version, and the one worth reading if you actually want to learn the language or decide whether to learn it, takes a few more paragraphs. So what is JavaScript, really? It is a scripting language that started life inside the browser in 1995, got a standards body wrapped around it, and now powers everything from Netflix's UI to PayPal's backend to the chat widget you ignored on a SaaS landing page this morning.

I have shipped production code in JavaScript for years. I have also been burned by it, which I will get to. Here is the explainer I wish someone had handed me when I started.

The Short JavaScript Definition (Without the Fluff)

JavaScript is a high-level, dynamically typed, interpreted programming language that was originally designed to make web pages do things after they loaded. Click a button, fetch some data, update part of the page without a full reload. That was the original job.

It has grown well past that. The same language now runs on servers (through Node.js), on phones (via React Native), on desktops (Electron apps like VS Code and Slack), and on tiny IoT devices. The language itself follows a specification called ECMAScript, maintained by a committee called TC39 under Ecma International. When someone says "ES6" or "ES2015," they are talking about a version of that spec.

A working JavaScript definition in one sentence: it is the language browsers natively understand, formalised by the ECMAScript standard, and now used far beyond the browser thanks to runtimes like Node.

A Quick History Of JavaScript (It Was Written In 10 Days)

The history of JavaScript starts at Netscape in May 1995. Brendan Eich wrote the first version in about ten days. The name was a marketing decision, riding on Java's popularity at the time, which is why beginners still ask whether they should learn Java or JavaScript thinking they are related. They are not. More on that in a moment.

The language was handed to Ecma International for standardisation in 1996, and the first ECMAScript spec came out in 1997. Things moved slowly for about fifteen years. Then ES6 dropped in 2015 and changed the language meaningfully: let and const, arrow functions, classes, modules, promises. Since then TC39 has shipped a new edition every year, which is roughly the cadence the language has held to.

The other big inflection point was 2009, when Ryan Dahl took Chrome's V8 engine and embedded it in a C++ program he called Node. Suddenly you could run JavaScript outside a browser. That single decision is why JavaScript is now a back-end language too.

What Is JavaScript Used For In Web Development And Beyond

The honest answer to "what is JavaScript and what is it used for" depends on which year you ask. For a long time it was just browser glue. Today the surface area is huge.

Here is what you can build with it:

  • Interactive websites. The original job. Form validation, dropdowns, modals, anything that responds to a click without refreshing the page.
  • Single-page applications. Gmail, Figma, Linear, Notion. The whole UI is rendered and updated by JavaScript running in your browser.
  • Server-side APIs. REST or GraphQL backends written in Node, often handling thousands of concurrent requests per process.
  • Mobile apps. React Native and Expo. The Facebook, Instagram, and Discord mobile apps all ship JavaScript.
  • Desktop apps. Electron wraps a Chromium browser around your code. VS Code, Slack, Figma's desktop client, all Electron.
  • CLIs and dev tooling. Most of the build tools you use, including Vite, ESLint, and Prettier, are JavaScript.
  • Real-time systems. Chat, multiplayer games, video call signalling. Socket-based servers are a natural fit for Node's event loop.
  • Games. Browser games via Canvas or WebGL, often with Phaser or Three.js.

So when someone asks what JavaScript is used for in web development specifically, the answer is: both sides. It writes the client-side code that runs in the user's browser, and through Node it handles server-side development too. Front-end development and back-end development in one language is the reason "full-stack JavaScript developer" became a job title.

Where The Code Actually Runs

Every browser ships with a JavaScript engine. Chrome and Edge use V8. Firefox uses SpiderMonkey, which Brendan Eich's original implementation eventually became. Safari uses JavaScriptCore. These engines parse your code, optimise it (modern engines JIT-compile hot paths, so the interpreted vs compiled code distinction is genuinely fuzzy now), and execute it.

The engine itself is the runtime. The browser adds things on top: the DOM, fetch, localStorage, setTimeout. Node adds a different set of things on top of V8: the filesystem module, network sockets, child processes. Same language, different host environment, different available APIs.

One thing that trips up beginners: JavaScript is single-threaded by design. Your code runs on one thread. But the runtime around it (browser or Node) handles I/O off that thread and notifies your code when results come back. That is why asynchronous operations using async/await and promises are so central to writing JavaScript that does not freeze. The JavaScript running order is: synchronous code first, then microtasks (resolved promises), then macrotasks (timers, I/O callbacks). Understanding that order is the difference between code that works and code that looks like it should work.

The browser also enforces a security model. Code from one origin cannot read data from another origin unless that origin opts in via CORS. This is why you cannot just fetch someone's bank API from your script. Good. You do not want that.

The Syntax, Variables, And Data Types You Actually Need First

Let me cover the JavaScript syntax basics quickly, because every explainer hides the actual language behind theory and I find that annoying.

Here is what is JavaScript with example code, the simplest possible piece:

console.log("Hello, world");

Open Chrome DevTools (right-click, Inspect, Console tab), paste that, hit Enter. You just ran JavaScript. No build step, no install, nothing.

Now JavaScript variables. There are three keywords, and you should mostly use one of them:

const name = "Ada";      // use this by default
let count = 0;           // use this when you need to reassign
var legacy = "avoid";    // pre-ES6, function-scoped, do not use in new code

const does not mean the value is immutable, by the way. It means the binding cannot be reassigned. You can still push to a const array. This catches everyone once.

The data types in JavaScript split into primitives and objects. Primitives: string, number, boolean, null, undefined, bigint, symbol. Everything else is an object, including arrays and functions. Because this is a dynamically typed language, a variable that holds a string today can hold a number tomorrow and the interpreter will not complain until something breaks at runtime. This is liberating when you are prototyping and miserable when you are debugging a production incident at 2am. It is also why TypeScript exists.

Functions in JavaScript are first-class values. You can pass them around, return them, assign them to variables:

function add(a, b) {
  return a + b;
}

const multiply = (a, b) => a * b;

const numbers = [1, 2, 3].map(n => n * 2);
// numbers is now [2, 4, 6]

That arrow function on line 5 is an ES6 addition. Concise, but the this binding behaves differently from a regular function, which has bitten me more than once inside class methods.

👉 Also read: How JavaScript Objects And Methods Actually Work Under The Hood

The Features Of JavaScript That Make It Weird (And Useful)

Here are the features of JavaScript that distinguish it from, say, Python or Java:

  • Prototype-based inheritance. Objects inherit from other objects directly. The class keyword added in ES6 is sugar over this.
  • First-class functions and closures. Functions remember the scope they were defined in. This is what makes callbacks, currying, and module patterns work.
  • Event loop concurrency. Single-threaded execution with non-blocking I/O. Different mental model from threads.
  • Dynamic typing with optional gradual typing via TypeScript. You can start loose and tighten later.
  • Multiple programming paradigms. You can write it object-oriented, functional, procedural, or some ugly mix of all three. The language does not force a style.
  • Truthy and falsy coercion. 0, "", null, undefined, NaN, and false are falsy. Everything else is truthy. Use === instead of == and you will avoid most of the famous "JavaScript is weird" memes.

The advantages and disadvantages of JavaScript both come from the same source: it runs everywhere, was designed in a hurry, and has to stay backwards compatible with twenty-five years of code. So you get incredible reach and a language that occasionally surprises you. typeof null === "object" is a bug from 1995 that will never be fixed because too much code depends on it.

Types Of JavaScript You Will See In The Wild

When people talk about types of JavaScript, they usually mean one of three things: language versions, dialects, or runtime environments.

  • Language versions. ES5 (2009) is the old baseline. ES6/ES2015 is the big modern jump. Every yearly release since adds features, but the gap between ES5 and ES6 is the one to know.
  • Dialects and supersets. TypeScript adds static types. JSX is JavaScript with embedded HTML-like syntax for React. CoffeeScript existed and is mostly dead now.
  • Runtime environments. Browser JavaScript, Node.js, Deno, Bun, and edge runtimes like Cloudflare Workers. Same core language, different available APIs.

If you are starting out, write modern JavaScript (ES2020 or later) in the browser console, then in Node, then consider TypeScript once you feel the pain of dynamic typing on a project with more than a few hundred lines.

What Is A JavaScript Framework, And How Is It Different From A Library

The question "what is a JavaScript framework" comes up constantly, usually right next to "what is a JavaScript library." The two get used interchangeably and they should not.

A library is code you call. You decide when to invoke it. jQuery, Lodash, Axios, date-fns. You import a function, you call it, you get a result.

A framework is code that calls you. It owns the application's structure and lifecycle, and you fill in specific slots with your code. Angular and Ember are full frameworks in this sense. The JavaScript framework vs library line gets fuzzy with React (technically a library, but treated like a framework once you add a router and a state manager) and Vue (a "progressive framework" that scales between the two).

The most popular JavaScript frameworks today, by usage and job listings, are React, Vue, Angular, Svelte, and Solid for the front end, plus Next.js, Nuxt, Remix, and SvelteKit as meta-frameworks built on top of those. On the back end, Express is still the default, with Fastify, NestJS, and Hono as serious alternatives.

Pick one. Learn it deeply. The patterns transfer.

👉 Also read: How To Detect Word Wrap In A Textarea With JavaScript

Java vs JavaScript: They Are Not Related

I get this question often enough that it needs its own section. The difference between Java and JavaScript explained in one line: Java is a statically typed, compiled, class-based language that runs on the JVM. JavaScript is a dynamically typed, interpreted, prototype-based language that runs in browsers and Node. The shared name is a 1995 marketing decision and nothing more.

If you are asking "should I learn Java or JavaScript" as your first language, my honest take: JavaScript has a lower barrier to seeing something work (open a browser, you are done) and a wider range of job types. Java has a more disciplined type system and dominates large enterprise backends and Android. Neither choice is wrong. Pick the one closest to what you actually want to build in six months.

Enabling JavaScript On Your Browser And Phone

Most of the support questions I see are not about writing JavaScript but turning it on. Browsers ship with it enabled by default, but if you disabled it or are using a locked-down device, here is what you need.

On desktop Chrome. For how to enable JavaScript in Chrome, open chrome://settings/content/javascript, or go to Settings, Privacy and Security, Site Settings, JavaScript, and choose "Sites can use JavaScript." This is also the answer for how to enable JavaScript in Google Chrome since they are the same browser.

On iPhone. For how to enable JavaScript on iPhone, open the Settings app, scroll to Safari, tap Advanced, and toggle JavaScript on. Safari is the only browser engine allowed on iOS, so this setting affects every browser-shaped app on the device.

On Android. To enable JavaScript on Android in Chrome, tap the three-dot menu, Settings, Site settings, JavaScript, and switch it on. The flow is similar in Samsung Internet and Firefox Mobile.

If you just want the short version of how to enable JavaScript on your phone: it is in the browser's site settings, and it is almost certainly already on. The MDN Web Docs site has a good walkthrough if you are stuck on a less common browser, and W3Schools has beginner-friendly examples once you have it running.

What I Would Actually Tell A Beginner

If you are starting out, do not read fifteen articles before writing code. Open Chrome DevTools, paste console.log(2 + 2), watch the 4 appear, then change it. Build something small and ugly. A todo list. A tip calculator. A page that fetches weather from a public API. The point is not the project. The point is feeling how the language behaves when you push on it.

The thing nobody tells you: JavaScript will feel arbitrary for the first month. this will surprise you. Promises will feel like an over-engineered callback. Type coercion will eat one of your afternoons. That is fine. The language has weird edges because it was designed quickly and then frozen in place by the web's backwards-compatibility promise. Once you have those edges mapped, it is one of the most productive languages I have used, mostly because the feedback loop (save, refresh, see result) is shorter than anywhere else.

Stop reading. Go write some.