98 Fun Facts About JavaScript
Learn something new, then test yourself with the quiz.
Know these facts? Prove it.
Take the 98-question quizWho created JavaScript in 1995?
Brendan Eich wrote the first version in ten days in May 1995; he went on to co-found the Firefox maker and, in 2015, the Brave browser company.
At which company was JavaScript created in 1995?
Netscape, founded in 1994 by Jim Clark and Mosaic co-author Marc Andreessen, wanted its browser to do more than display static pages and hired a language designer in April 1995 to build a scripting language.
What was JavaScript called when it first shipped in a browser beta in September 1995?
LiveScript was the name in the September 1995 beta of the 2.0 browser; the switch to JavaScript came that December, borrowing the glow of a hotter language.
JavaScript's creator was originally recruited to embed which existing language in the browser?
Scheme, the minimalist Lisp dialect, was what the new hire had been promised he could put in the browser; management then demanded a more conventional syntax, and first-class functions were the main thing to survive from the plan.
In December 1995, which company jointly announced JavaScript with the browser maker in a press release?
Sun Microsystems and the browser maker issued the joint press release on 4 December 1995; the new name was a co-branding move, meant to ride the fame of Sun's own hot new language.
Management wanted the syntax of the new browser scripting language to resemble which language?
Java was the model: a management diktat said the new language must 'look like Java', so it took Java's braces and keywords even though it works very differently underneath.
The core language standard is published under which document number?
ECMA-262 is the standard for the language itself, first published in June 1997; ECMA-404 is JSON, ECMA-334 is C#, and ECMA-119 is the ISO 9660 CD-ROM file system.
Ecma International, the standards body behind JavaScript, has been based since 1961 in which Swiss city?
Geneva has housed Ecma since it was founded in 1961 as the European Computer Manufacturers Association; when it went global in 1994 it dropped the acronym and kept Ecma as a plain name.
What did Microsoft call its own version of JavaScript when it shipped in Internet Explorer 3.0 in 1996?
JScript shipped in Internet Explorer 3.0 in August 1996; Microsoft gave its version a different name to get around the trademark on 'JavaScript', though it was the same language.
Which term did Jesse James Garrett coin in 2005 for loading data in the background without a full page reload?
Ajax, short for Asynchronous JavaScript and XML, was the label in Garrett's February 2005 essay; the XMLHttpRequest object behind it came from Microsoft's Outlook Web Access team and first shipped in Internet Explorer 5.
Which JavaScript engine did Google build for the 2008 launch of its Chrome browser?
V8, named after the car engine, was built not at Google's California base but in Denmark, by a small team under Lars Bak, and launched with Chrome on 2 September 2008.
Which engine, descended from the very first one written for JavaScript, powers the Firefox browser?
SpiderMonkey began when the language's creator stayed home for two weeks in 1996 to rewrite his rushed original engine; opened to outside developers along with the browser's code, it ended up inside Firefox.
Apple's WebKit and its JavaScript engine began in 2001 as forks of the engines inside which browser?
Konqueror's KHTML and KJS engines were picked because they were small, under 140,000 lines, and cleanly designed, as Apple's Safari team told the KDE developers in 2003.
Node.js was created in 2009 by whom?
Ryan Dahl built Node because servers that give every connection its own thread cope badly with thousands at once; his design keeps a single thread and never blocks while waiting on input or output.
Node's creator later co-created which runtime, announced in a 2018 talk about his regrets?
Deno, an anagram of Node, was unveiled in his talk '10 Things I Regret About Node.js'; it answers one regret by refusing scripts any file or network access until they are given permission.
The Bun runtime, unlike Node, is built on which engine?
JavaScriptCore, the engine Apple builds for Safari, powers Bun; its makers say the choice cuts startup time and memory use, the runtime's main selling points.
Which package manager was introduced for Node.js in January 2010?
npm was first published in January 2010 and bundled with Node from late 2011; its documentation insists the name is a recursive backronym for 'npm is not an acronym', not 'Node Package Manager'.
In March 2016, the unpublishing of which tiny package broke Babel and thousands of other builds?
left-pad, an 11-line function, vanished when Azer Koçulu unpublished all his modules after the registry sided with the messaging company Kik in a dispute over the name 'kik'; thousands of builds broke until it was restored.
Which fork of Node.js did Fedor Indutny start in December 2014 amid a dispute over the project's governance?
io.js was run by an open technical committee instead of a single company; nine months on, the two projects reunited as Node.js 4.0 under a new neutral foundation.
Which web framework for Node.js did TJ Holowaychuk release in 2010?
Express outlasted its author's interest in Node: in 2014 Holowaychuk handed the project to the company StrongLoop and announced he was leaving Node for the Go language.
Who created jQuery in January 2006?
John Resig unveiled jQuery at BarCamp NYC in January 2006, influenced by Dean Edwards' cssQuery; its chainable methods and CSS-style selectors made cross-browser DOM scripting bearable.
React was created by Jordan Walke, a software engineer at which company?
Facebook engineer Jordan Walke built the early prototype, FaxJS, and brought it into the company's code; in 2012 Instagram's web team chose to build its whole site with it.
Which syntax, unveiled with React in 2013, lets developers write HTML-like markup inside JavaScript?
JSX grew out of XHP, a PHP extension its makers already used to build pages; browsers cannot read it, so a compiler turns every tag into a plain function call.
Which React feature, released in version 16.8, lets function components keep state without writing a class?
Hooks such as useState arrived in February 2019 and took over so fully that React's own documentation later moved class components to a section called legacy APIs.
Vue.js was created by which developer after he had worked at Google with AngularJS?
Evan You, then at Google Creative Lab, began Vue to keep the parts of AngularJS he liked without the weight; it was publicly announced in February 2014 and is pronounced like 'view'.
Svelte, the framework that compiles components away at build time, was created by whom?
Rich Harris built Svelte's forerunner, Ractive, at The Guardian for interactive news apps; Svelte followed in 2016 because, he wrote, 'we're shipping too much code to our users'.
Next.js, the React framework with server-side rendering, was created by which company?
Vercel was still called ZEIT when Guillermo Rauch's team put Next.js on GitHub in October 2016; the company took its present name only in April 2020.
Which engineer created AngularJS, the framework Google later rewrote from scratch as Angular?
Miško Hevery's original lost out to its own successor: once the rewrite had taken over, Google ended all support for AngularJS at the close of 2021.
Ember.js got its name in December 2011 when which framework's 2.0 version was renamed?
SproutCore 2.0, the rewrite Yehuda Katz and Tom Dale led, was renamed Ember.js in December 2011 because it had diverged so far from the original framework; Katz later sat on TC39, the committee that steers the language.
CoffeeScript, Backbone.js and Underscore.js were all created by which developer?
Jeremy Ashkenas made his first CoffeeScript commit on 13 December 2009, labelled 'initial commit of the mystery language', having released Underscore.js earlier that year; Backbone.js followed in October 2010.
What does the D3 in D3.js stand for?
Data-Driven Documents binds data straight to the page's own elements; Mike Bostock's Stanford team dropped their earlier Protovis library for it, because Protovis hid its scene in a private layer that was hard to debug.
Which graphics library did the developer known as Mr.doob first publish on GitHub in April 2010?
Three.js came from Ricardo Cabello, who signs his code Mr.doob; it became the base that later 3D tools are built on, among them the A-Frame virtual reality framework.
Electron, the desktop framework behind VS Code, Slack and Discord, was originally built for which editor?
Atom, GitHub's own editor, came with a custom shell that was renamed Electron in 2015; GitHub retired Atom itself in December 2022, while the shell built for it lives on.
Which creator of Turbo Pascal and C# led Microsoft's TypeScript project?
Anders Hejlsberg unveiled TypeScript in October 2012; in 2025 he announced that its compiler, long written in TypeScript itself, was being ported to Go to run about ten times faster.
What does the strict equality operator === check that == does not?
That both operands have the same type is the extra check: === compares without type coercion, so 1 === '1' is false while 1 == '1' is true, because == first converts the operands to a common type.
Who specified the JSON data format, later writing it up as RFC 4627?
Douglas Crockford licensed his JSON code with one extra line, 'The Software shall be used for Good, not Evil', a clause that makes it non-free in the eyes of the GNU project.
Why did JSON's designer say he removed comments from the format?
People were using them to hold parsing directives, the designer explained, 'a practice which would have destroyed interoperability'; JSON also forbids trailing commas and single-quoted strings.
Which portable binary format, a W3C recommendation since 2019, lets C, C++ and Rust run in browsers?
WebAssembly was designed jointly by the big browser makers, a truce that led Google to retire Native Client, its own rival way of running compiled code on the web.
asm.js, the JavaScript subset designed to be compiled ahead of time, was started at which organisation?
Mozilla engineers defined asm.js, and in 2013 Firefox 22 became the first browser tuned for it; what its makers learned then shaped the binary format that replaced it.
Which company took over the 'JavaScript' US trademark by buying the firm that first registered it?
Oracle inherited the mark through that purchase; in 2024 the language's creator and thousands of developers signed an open letter asking Oracle to let it go, and a petition to cancel the mark followed.
Which JavaScript engine for the JVM is named after the animal on the cover of O'Reilly's JavaScript guide?
Rhino was begun in 1997 for a browser project that was soon cancelled; the engine escaped the axe, and a version of it was later bundled with the JDK itself.
Block-scoped let and const were added in which edition of JavaScript?
ES6 (2015) introduced let and const with block scope; before that, var gave only function scoping and developers faked blocks with immediately-invoked function expressions.
Which object, added in ES2015, lets code intercept property reads and writes on another object?
Proxy wraps a target object in handler 'traps' that run on every property read or write; Vue 3 rebuilt its change tracking on it, replacing the getter-and-setter workaround of Vue 2.
Since ES6, how often is a new edition of the JavaScript standard finalised?
Annually, each June, Ecma approves a snapshot of a draft that is edited in the open on GitHub; the first yearly edition, ES2016, added little beyond the ** operator and one array method.
Which JavaScript value fails an equality check against itself?
NaN, short for Not a Number, is the only value for which x === x is false, which is why Number.isNaN exists; despite its name, typeof NaN returns 'number'.
Which of these values is truthy in JavaScript?
The string "0" is truthy because every non-empty string is, whatever it spells; only a short list of values, such as false, the number 0, the empty string and null, count as falsy.
Template literals with embedded ${expression} syntax are wrapped in which punctuation mark?
The backtick (`) wraps template literals; put a function name in front of one and the function receives its pieces, the trick that lets styled-components write CSS inside JavaScript.
How are ordinary JavaScript numbers represented in memory?
IEEE 754 double-precision floats hold every ordinary number, which is why 0.1 + 0.2 gives 0.30000000000000004 and integers are exact only up to 2^53 - 1; Infinity and its negative are numbers too.
Which primitive type, added in ES2020, is written as a whole number with a trailing n?
BigInt stores integers of any size, written like 9007199254740993n, which ordinary numbers cannot hold exactly; mixing the two types in arithmetic throws an error.
Implementing which built-in key lets an object work with for...of and the spread operator?
Symbol.iterator names the method that for...of and spread call to get an iterator; because it is a symbol rather than a string, it can never collide with a property older code already uses.
A JavaScript Date object stores a millisecond count from midnight UT on which date?
1 January 1970 at midnight UTC is the epoch, so Date.now() returns milliseconds since then; the range is about plus or minus 100 million days, which comfortably covers recorded history.
The with statement becomes a syntax error once a script opts into what?
Strict mode, enabled by the 'use strict' directive or automatically inside modules and classes, bans the with statement and refuses assignments to undeclared variables, which used to silently create globals.
A JavaScript identifier may begin with a letter, an underscore, or which other character?
The dollar sign is a valid identifier start, which is why jQuery's whole API hangs off $(); identifiers may also begin with an underscore or any Unicode letter, but never with a digit.
JavaScript's object model does inheritance through what, rather than classes?
Prototypes are the mechanism: each object holds a link to another object from which it inherits properties, an idea popularised by the Self language of David Ungar and Randall Smith; the later class syntax is sugar over the same chain.
Which mechanism processes JavaScript's message queue one task at a time?
The event loop takes one message at a time from the queue and runs its callback to completion before looking at the next, which is why a long-running task freezes the page.
Which built-in method converts a JavaScript value into JSON text?
JSON.stringify converts a value to JSON text, dropping functions and undefined properties and calling any toJSON method it finds; its optional second and third arguments filter keys and set indentation.
Node.js got its first public demo in Berlin in November 2009 at which conference?
JSConf EU's first edition hosted the demo on 8 November 2009; the cloud company Joyent went on to sponsor the project and employ its creator.
Which city, home of browser maker Opera, hosted the July 2008 meeting that ended JavaScript's ES4 feud?
Oslo hosted the TC39 meeting in July 2008 where the ES4 and ES3.1 camps agreed on 'Harmony', announced that August: the ambitious fourth edition was dropped and ES3.1 became ES5 in December 2009.
Which JavaScript value makes the typeof operator report "object", a bug kept since the language's first version?
null reports "object" because the first JavaScript engine tagged objects with zeros and stored null as an all-zero pointer. A fix was later proposed and rejected, so the quirk stayed.
The first version of JavaScript was famously completed in 1995, to meet a browser beta deadline, in roughly how long?
Ten days was all the browser's release schedule allowed. A typeof bug from that first implementation is still in the language today.
The JavaScript data type with just two possible values is named after which nineteenth-century English mathematician?
George Boole set out his algebra of logic in the mid-1800s, long before computers existed. His two-valued system now decides every if statement a program runs.
JavaScript's + operator both adds and joins, so what does the expression "2" + 2 evaluate to?
The string "22" appears because + joins as soon as either side is text, converting the other side to match. Subtraction has no such second job, so "2" - 2 gives 0.
What does the comparison 0.1 + 0.2 === 0.3 evaluate to in JavaScript, a famous trap for beginners?
false is the result because 0.1 and 0.2 have no exact binary form, so their sum comes out as 0.30000000000000004.
Which month does JavaScript's Date method getMonth report as the number 9, to the surprise of many beginners?
October is month 9 because getMonth numbers the months 0 to 11, which makes the result handy as an index into an array of month names.
Before being renamed twice during 1995, the language now known as JavaScript first went by which name?
Mocha was the language's very first name, and both renamings came before the end of 1995. Mocha is now also the name of a JavaScript test framework.
Which nickname do developers give plain JavaScript written without any libraries or frameworks at all?
Vanilla JS borrows the ice-cream sense of plain and unadorned. A spoof website even markets it as the most lightweight framework available anywhere.
What does the abbreviation JSON stand for, the text data format that nearly took the name JSML instead?
JavaScript Object Notation beat JSML, JavaScript Markup Language, in a vote by the startup founders who named it. Despite the name, the format is language-independent and used far beyond JavaScript.
Rather than throwing an error, JavaScript returns which special value when a positive number is divided by zero?
Infinity is an ordinary number value in JavaScript, so the calculation carries on instead of crashing. Dividing a negative number by zero gives -Infinity.
In a JavaScript file, which characters turn the rest of a line into a comment that the engine ignores?
Two forward slashes begin a line comment that ends where the line does. Longer notes sit between /* and */ instead and can run across several lines.
In JavaScript, what job does a single equals sign perform, in contrast to the doubled and tripled versions?
Assignment copies the value written after the sign into the variable named before it. The operation hands that value back as its own result, so several can be chained, as in a = b = 5.
Which pair of characters encloses a JavaScript array literal, such as a list of three numbers?
Square brackets wrap an array literal, with commas between the items. The same characters read an item back by its position, counting from zero.
Which property reports how many elements a JavaScript array contains, and also works on strings?
length keeps itself up to date as an array grows, and it can be written as well as read: setting it to a smaller number deletes the elements beyond that point.
Which character, placed before a JavaScript expression, acts as logical NOT and inverts its truth value?
An exclamation mark turns a truthy value into its opposite. Doubling it, as in !!value, is a common shortcut for forcing any value into a plain yes-or-no.
Which JavaScript operator gives the leftover after a division, so that placing it between 7 and 2 yields 1?
% is the remainder operator, and its result always takes the sign of the dividend, so -7 % 2 gives -1. In Python the same character follows the divisor instead.
Which JavaScript construct, written with a question mark and a colon, is a compact alternative to if...else?
The ternary operator is the only one in JavaScript that takes three parts: a condition, a result if the condition is met and a result if it is not.
In a JavaScript switch statement, which keyword stops execution from falling through into the next case clause?
break ends the switch at that point. Leave it out and execution runs straight on into the following case, even when that case's value does not match.
Which JavaScript looping statement always runs its body at least once because the condition is tested afterwards?
A do...while loop checks its condition only after each pass, so the body runs even when the condition is untrue from the start. A plain while loop may never run at all.
JavaScript strings are sequences of code units in which Unicode encoding, the reason an emoji can count as two?
UTF-16 fits most characters into a single 16-bit unit but needs a pair of them, known as surrogates, for emoji and other rarer characters.
Which JavaScript array method adds new elements to the end of an array and is reversed by calling pop?
push adds to the end and hands back the array's new size, and its counterpart unshift does the same job at the front.
Which JavaScript array method returns a new array containing the result of calling a function on every element?
map builds a fresh array the same size as the original and leaves the original untouched, which makes it the standard way to transform a list.
Which JavaScript array method can delete, replace or insert elements at any position, changing the array in place?
splice rewrites the very array it is called on. A newer sibling, toSpliced, returns an altered copy and leaves the original alone.
What does JavaScript's indexOf method return when the element being searched for is not in the array?
The value -1 signals a miss because 0 is a real position, the opening slot of the array. The newer includes method answers the same question with a plain yes or no.
With no compare function supplied, what does JavaScript's sort method turn the array [10, 9, 1] into?
[1, 10, 9] is the result because the default sort converts every element to text and compares character by character, so "10" lands ahead of "9".
Given plain text rather than a regular expression, JavaScript's replace method changes which of the matches it finds?
Only the first match is swapped unless the pattern is a regular expression carrying the g flag. The replaceAll method was added later to change every match in one call.
Which global JavaScript function reads the text "42px" and returns the number 42, ignoring the trailing letters?
parseInt reads digits from the front of the text and stops at the earliest character that is not a numeral. Number is fussier and rejects "42px" outright.
Which built-in JavaScript method turns the text "a,b,c" into an array of three items when passed a comma?
split cuts a string wherever the separator appears and returns the pieces as an array. The array method join is its mirror image and glues the pieces back together.
Which built-in JavaScript method strips whitespace from both ends of a piece of text, handy for tidying form input?
trim returns a new string with the whitespace gone from both ends and leaves the original unchanged. Its relatives trimStart and trimEnd tidy just one side.
What does the abbreviation DOM stand for, the tree of nodes that JavaScript uses to change a web page?
Document Object Model describes the page as a tree in which every element, attribute and piece of text is a node that code can read or rewrite.
Which built-in JavaScript function runs a piece of code once, after a delay given in milliseconds?
setTimeout fires just once when its timer runs out, whereas setInterval keeps repeating. The delay is only a minimum, because the code has to wait if the page is busy.
Which JavaScript keyword pairs with try to deal with an exception thrown inside the protected block?
catch receives the thrown exception so the program can respond instead of stopping. An optional finally block then runs whether or not anything went wrong.
Which built-in function lets JavaScript show a dialog box with a text field and return what the user enters?
prompt pauses the script until the visitor submits or cancels the box. Its siblings alert and confirm offer no text field, only a message and buttons.
What name do JavaScript developers give to a click travelling outwards from a button to fire its ancestors' handlers?
Event bubbling carries the click outwards from the innermost element to each ancestor in turn. A handler can halt the trip by calling stopPropagation.
Which attribute of the HTML script tag makes the browser run a JavaScript file only after the page has been parsed?
defer fetches the file in the background and runs it once parsing is finished, keeping scripts in the order they appear. Its cousin async runs each one as soon as it arrives.
Which JavaScript statement pauses execution at that line whenever the browser's developer tools are open?
debugger behaves like a breakpoint written straight into the code. When no debugging tool is attached, the statement does nothing at all.
Microsoft's original Edge browser ran on which home-grown JavaScript engine, retired after Edge moved to Chromium?
Chakra had its code made public in 2016 under the name ChakraCore, but Microsoft ended support for it in 2021 once Edge had switched to a Chromium-based engine.
The JavaScript engine Rhino took its name from the animal on the cover of a JavaScript book from which publisher?
O'Reilly Media is known for the animal woodcuts on many of its covers, and the one on its JavaScript guide is a rhinoceros.
Which method of a JavaScript event object cancels the browser's built-in response, such as following a clicked link?
preventDefault only switches off the browser's own reaction, such as opening a link or pasting text. The event itself carries on travelling through the page as usual.
Which built-in call lets JavaScript developers print a debugging message to the browser's developer tools panel?
console.log writes to the developer tools instead of the page, so ordinary visitors never see the message.
Think you know JavaScript?
Put these facts to the test with the interactive quiz.
Take the 98-question quizTeaching JavaScript?
Make a custom quiz — handy for classrooms and study groups.
Make a quiz on anything