Cell biology flash cards
Flash cards on cell structure, organelles, plant and animal cells, bacteria, diffusion, osmosis, active transport, mitosis and microscopy for school biology.
Flash card deck22 cardsBeginnerAnyone
Twenty-two flash cards on JavaScript fundamentals: let and const, types, arrays, objects, functions, loops, the DOM and events, with short code examples.
Free to use, edit, print and study. No account needed: your set stays on this device.
let and const
Both declare variables. Use const for a value that will not be reassigned and let for one that will. Older code uses var, which has looser scoping rules.
const name = 'Mia';
let count = 0;
Primitive data types
console.log()
Prints a value to the browser's developer console. It is the quickest way to check what your code is doing.
console.log(count);
=== vs ==
=== checks value and type with no conversion, so 5 === '5' is false. == converts types first, so 5 == '5' is true. Prefer ===.
Template literal
A string in backticks that can insert values with ${ }.
`Hello, ${name}!`
if and else
if (score >= 50) {
console.log('Pass');
} else {
console.log('Try again');
}
Logical operators
&& means and, || means or, ! means not.
if (age >= 13 && hasPermission) { ... }
Truthy and falsy
In a condition, these values count as false: false, 0, '' (empty string), null, undefined and NaN. Everything else counts as true.
for loop
for (let i = 0; i < 3; i++) {
console.log(i);
}
prints 0, 1 and 2.
Array
An ordered list in square brackets, indexed from 0.
const colours = ['red', 'blue'];
colours.push('green'); adds to the end.
colours.length is 3.
Array methods map, filter, forEach
map makes a new array by changing each item. filter keeps items that pass a test. forEach runs code for each item.
[1, 2, 3].map(n => n * 2) gives [2, 4, 6].
Object
Stores key and value pairs in curly braces.
const user = { name: 'Ana', age: 15 };
user.name gives 'Ana'.
Function declaration
function add(a, b) {
return a + b;
}
add(2, 3) returns 5.
Arrow function
A shorter way to write a function.
const add = (a, b) => a + b;
Scope
Where a variable can be used. Variables declared with let or const inside curly braces exist only inside that block.
DOM
The Document Object Model: the browser's representation of a web page as objects that JavaScript can read and change.
Selecting an element
document.querySelector('#title') returns the first element matching a CSS selector. querySelectorAll returns all matches.
Changing page content
element.textContent = 'New text'; changes the text inside an element.
element.classList.add('active'); adds a CSS class.
Event listener
Runs code when something happens, such as a click.
button.addEventListener('click', () => {
alert('Clicked!');
});
JSON
JavaScript Object Notation, a text format for data. JSON.stringify(obj) turns an object into a string; JSON.parse(text) turns it back.
Promise and async/await
A promise represents a result that arrives later, such as data from a server. Inside an async function, await pauses until the promise settles.
const res = await fetch(url);
Comments
// starts a one-line comment.
/* ... */ wraps a comment over several lines.
This deck covers the JavaScript you need to start building interactive web pages: variables, data types, comparisons, conditions, loops, arrays, objects, functions, the DOM, events and a first look at asynchronous code. It suits school and college computing students, coding bootcamp beginners and self-taught web developers. Examples use modern syntax (let, const and arrow functions). Read each card in Learn mode, then try the example in your browser's developer console. Use Test mode and spaced repetition to keep the syntax fresh, and print double-sided for a desk reference.
Updated October 28, 2026