Category

JavaScript Tutorials

JavaScript tutorials covering ES features, DOM manipulation, async/await, arrays, functions, frameworks, and the patterns every modern web developer should know.

51
Total Tutorials
23
New this month
Showing 12 of 51 · page 2 of 5
AI That Reads PDFs in JavaScript — Three Strategies
JavaScript
26 min
Jun 1, 2026
AI That Reads PDFs in JavaScript — Three Strategies
Every AI PDF tutorial uses Python and LangChain. This one doesn't. Learn three pure JavaScript strategies for making AI read PDFs — direct text extraction, GPT-4o Vision for scanned documents, and structured JSON extraction — all in a single browser file. Plus the PDF.js worker gotchas, the API-key-in-the-browser elephant, and a free Tesseract.js OCR fallback nobody documents.
W
W3Tweaks Team
Vercel AI SDK in Plain JavaScript (No Next.js)
JavaScript
25 min
May 31, 2026
Vercel AI SDK in Plain JavaScript (No Next.js)
Every Vercel AI SDK tutorial assumes Next.js. This one doesn't. Learn how to use AI SDK Core in a plain Node.js script, build a minimal Express server that streams to vanilla HTML, switch providers with one line, and generate structured JSON with Zod — zero framework required.
W
W3Tweaks Team
WebLLM: Run LLMs in the Browser with JavaScript
JavaScript
15 min
May 30, 2026
WebLLM: Run LLMs in the Browser with JavaScript
WebLLM uses WebGPU to run quantized Llama, Phi, Gemma, and Mistral models entirely inside your browser tab. No server, no API key, no data ever sent to the cloud. The model downloads once, caches in the browser, and runs at near-native GPU speed.
W
W3Tweaks Team
Build a RAG App in the Browser with JavaScript
JavaScript
13 min
May 29, 2026
Build a RAG App in the Browser with JavaScript
RAG lets AI answer questions about your own documents by retrieving the most relevant passages before generating a response. This tutorial builds a complete in-browser RAG system in vanilla JavaScript — embeddings, vector search, and GPT generation all without a backend.
W
W3Tweaks Team
OpenAI Function Calling in JavaScript (Vanilla JS Guide)
JavaScript
14 min
May 28, 2026
OpenAI Function Calling in JavaScript (Vanilla JS Guide)
Function calling lets the AI decide when to invoke your own JavaScript functions and what arguments to pass. The result: AI that fetches real data, runs calculations, searches your database, and controls your UI — all driven by natural language.
W
W3Tweaks Team
Run AI Locally with Ollama and JavaScript
JavaScript
14 min
May 26, 2026
Run AI Locally with Ollama and JavaScript
Ollama lets you run powerful AI models like Llama 3, Mistral, and Gemma entirely on your own machine — free forever, no API key, zero data sent to the cloud. This tutorial shows you how to call Ollama from JavaScript with the same fetch pattern you already know.
W
W3Tweaks Team
Build a Chatbot Widget with HTML, CSS & JavaScript
JavaScript
15 min
May 22, 2026
Build a Chatbot Widget with HTML, CSS & JavaScript
Build a floating chat bubble widget that opens into a full AI chat panel — pure HTML, CSS, and Vanilla JavaScript. Connects to OpenAI, streams responses, remembers conversation history, and embeds into any website with a single script tag.
W
W3Tweaks Team
Build an AI Color Palette Generator with JavaScript
JavaScript
17 min
May 22, 2026
Build an AI Color Palette Generator with JavaScript
Build a real working tool: type a mood or theme, and AI generates a five-color palette with names and use cases. Pure HTML, CSS, and Vanilla JavaScript — no frameworks, no build step, ships in one file.
W
W3Tweaks Team
Web Speech API: Build a Voice Command UI in JavaScript
JavaScript
13 min
May 22, 2026
Web Speech API: Build a Voice Command UI in JavaScript
The Web Speech API lets you add voice input and text-to-speech to any website with zero dependencies. This tutorial builds a fully working voice command UI — wake word detection, command matching, and spoken responses — in pure JavaScript.
W
W3Tweaks Team
Build a ChatGPT-Style Streaming Text Effect in JavaScript
JavaScript
14 min
May 21, 2026
Build a ChatGPT-Style Streaming Text Effect in JavaScript
The token-by-token streaming animation you see on ChatGPT, Claude, and Gemini is now everywhere. Here is how to build it yourself using pure JavaScript — covering CSS typewriter, ReadableStream, and real Server-Sent Events.
W
W3Tweaks Team
Call the OpenAI API from Vanilla JavaScript (No Backend)
JavaScript
13 min
May 21, 2026
Call the OpenAI API from Vanilla JavaScript (No Backend)
You do not need Node.js, React, or a backend server to start using the OpenAI API. This tutorial shows you how to call GPT models directly from plain JavaScript using the Fetch API — with streaming, error handling, and secure key management.
W
W3Tweaks Team
JavaScript API Call: fetch, Axios, TanStack Query & ky
JavaScript
18 min
Jul 26, 2023
JavaScript API Call: fetch, Axios, TanStack Query & ky
Most JavaScript API call guides are still in 2023 — fetch + Axios + XMLHttpRequest + jQuery. The real modern comparison is fetch + async/await + AbortController (the modern baseline), Axios (still popular for interceptors), TanStack Query (the React standard), and ky/ofetch (lightweight replacements). Plus the 4xx/5xx error gotcha fetch doesn't reject for, the Axios CancelToken deprecation, type-safe APIs with Zod, and FormData uploads done right.
W
W3Tweaks Team