JavaScript for Luau Developers
Transfer Luau tables, gradual types and metatables to JavaScript arrays, Map, classes and ES modules. Compare truthiness, closures, receivers, errors and shallow copies, then build an order processor.
Luau and JavaScript side by side
The same program in Luau and in JavaScript, from the lessons of this course.
Concatenation to Templates
Luau supports backtick interpolation with braces around expressions, while JavaScript template literals put a dollar sign before each interpolation brace. Both also support ordinary quoted strings, which do not interpolate. Luau concatenates with double dots…
Luau1local name = "Ada"2print(`Hello, {name}!`)JavaScript1const name = "Ada";2console.log(`Hello, ${name}!`);Equality and Coercion
Luau compares different primitive types without treating numeric strings as numbers, and ordinary tables compare by identity. JavaScript strict equality has similar behavior for these examples; loose equality can coerce primitive values. A Luau equality…
Luau1print(3 == "3")2local a, b = {1}, {1}3print(a == b)JavaScript1console.log(3 === "3");Sequence Indexes and push
Luau sequence tables conventionally use one-based indexes and table.insert for appending. JavaScript arrays start at zero, and push returns the resulting length. Negative bracket indexes are property names rather than positions counted backward; at(-1) reads…
Luau1local items = {2}2table.insert(items, 3)3print(#items)4print(items[1])JavaScript1const items = [2];2items.push(3);3console.log(items.length);while, break, and continue
Luau and JavaScript both support continue to skip the rest of an iteration and break to exit the innermost loop. A while condition is tested before each pass. Preserve progress updates along every continuing path. Luau repeat/until stops when its condition…
Luau1local n = 32while n > 1 do n = n - 1 end3print(n)JavaScript1let n = 3;2while (n > 1) n -= 1;3console.log(n);Functions and Return Counts
Luau functions can return several results and annotate that result pack. JavaScript returns one value, which can be an array or object containing several fields. Ordinary function bodies require an explicit return; falling through yields undefined in…
Luau1local function twice(n: number): number2 return n * 23end4print(twice(4))JavaScript1function twice(n) { return n * 2; }2console.log(twice(4));JSON Without Evaluation
Luau JSON support comes from the host or a library, not a universal built-in JSON object. JavaScript supplies JSON.parse and JSON.stringify. The Luau pattern shown here extracts an integer from one fixed fixture; it is not a general parser. Use a real JSON…
Luau1local fixture = "[2,3]"2local second = fixture:match("^%[%d+,(%d+)%]$")3print(tonumber(second))JavaScript1console.log(JSON.parse("[2,3]")[1]);
Syllabus
10 chapters48 lessons1 project48 challenges99 quiz questionsFrom Luau to JavaScript
6 lessonsDecisions and Flow
5 lessonsTables to Arrays and Maps
5 lessonsIteration Pipelines
5 lessonsFunctions and Closures
5 lessonsErrors and ES Modules
5 lessonsMetatables to Classes
6 lessonsComposition and Dispatch
5 lessonsProject: Order Processor
4 lessonsApply Your Luau Experience
2 lessonsFrequently asked questions
Who is JavaScript for Luau Developers for?
For people who already write Luau and want to learn JavaScript. Each lesson starts from Luau you know and shows how JavaScript does the same thing, so you skip the beginner basics.
Do I need to know JavaScript already?
No. The course starts with your first JavaScript program. You need Luau basics: variables, conditions, loops, functions and collections.
How many lessons does JavaScript for Luau Developers have?
JavaScript for Luau Developers contains 48 interactive lessons you can complete at your own pace.
What does JavaScript for Luau Developers cover?
The course is organized into chapters covering: From Luau to JavaScript, Decisions and Flow, Tables to Arrays and Maps, Iteration Pipelines, and more.
Is JavaScript for Luau Developers free?
Yes. Every course on Coddy is free to start. You can complete lessons in your browser without any downloads or signup.