Please enable JavaScript to use CodeHS

Intro JS Glossary

Flashcards

Course:

Module:

Search:

lowerCamelCase General

`lowerCamelCase` is a naming convention where the first letter is lower case, and each subsequent start of a word is upper case.

lowerCamelCase

World General

A "world" or "Karel World" is a grid that karel lives in.

karel World

Karel General

Karel is a dog who listens to your commands.

Karel

Command JavaScript

A command is an instruction you can give to Karel.

Command

Define a Function JavaScript

Defining a function means to teach the computer a new command and explain what it should do when receiving that command.

Define a Function

Call a Function JavaScript

Calling a function actually gives the command, so the computer will run the code for that function.

Call a Function

Curly Bracket General

An open curly bracket is { and a close curly bracket is }

Curly Bracket

Function body JavaScript

The part of a function that contains the commands

function body

Read Like a Story JavaScript

Programs that "Read like a story" have good decomposition and make the code easy to follow.

Read Like a Story

Start Function JavaScript

This is the function that is called when you click run.

Start Function

Break Down (Decompose) JavaScript

Breaking down (decomposing) your code is splitting it into more functions.

Break Down (Decompose)

Indentation JavaScript

Indentation is the visual structure of how your code is laid out. It uses tabs to organize code into a hierarchy.

Indentation

Decomposition General

Decomposition is breaking your program into smaller parts.

Decomposition

Top Down Design JavaScript

Top down design is a method for breaking our program down into smaller parts.

Top Down Design

Programming Style General

The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.

Programming Style

Comment JavaScript

A message in your code that explains what is going on.

Comment

Precondition JavaScript

Assumptions we make about what must be true before the function is called.

Precondition

Postcondition JavaScript

What should be true after the function is called

Postcondition

SuperKarel General

SuperKarel is like Karel but already knows how to turnRight() and turnAround()

SuperKarel

Loop General

A loop is a way to repeat code in your program.

Loop

For Loop JavaScript

A for loop lets us repeat code a **fixed number of times**.

For Loop

Control Structure General

A control structure lets us change the flow of the code.

Control Structure loops if statements

Parentheses General

( and )

Parentheses

Condition General

A condition is code that you put inside an if statement or while-loop.

Condition

If Statement General

An if statement lets you ask a question to the program and only run code if the answer is true.

If Statement

If Else Statement General

Control structure that lets us run either one section of code or another depending on a test.

If Else Statement

While Loop General

Lets us repeat code as long as something is true.

While Loop

Fencepost Problem General

A problem when using a while loop where you forget one action at the beginning or the end.

Fencepost Problem

Hello World General

Traditionally the very first program you write when learning a programming language, a program that prints "Hello world" to the user.

println JavaScript

JavaScript function that prints out a line to the user

Boolean JavaScript

A boolean is a true or false value.

Boolean

Declare a Variable JavaScript

Declaring a variable is defining it for the first time.

Declare a Variable

Variable General

A symbol or container that holds a value.

variable

Integer JavaScript

A whole number (not a fraction)

integer

String JavaScript

A sequence of characters

string

Initialize a Variable JavaScript

Initializing a variable is giving it an initial value.

Float JavaScript

A float, or floating point value, is a numeric value that can have decimal level precision (ex: 3.14)

readLine JavaScript

Allows for the reading of user input when a string is used

readLine

readInt JavaScript

Allows for the reading of user input when an integer is used

readInt

readFloat JavaScript

Allows for the reading of user input when a float number is used

readFloat

Constant JavaScript

A variable in a program that has a value that does not change.

Constant

Magic Number JavaScript

A number in your code that appears arbitrary. These should all be replaced with calculations or constants.

Magic Number

Increment General

To add to or increase

Increment

Decrement General

To subtract from or decrease

decrement

Canvas JavaScript

The screen in which our graphics programs are drawn.

Canvas

Coordinate system JavaScript

A coordinate system uses numbers as coordinates to place objects in a geometric space.

coordinate system

getWidth() JavaScript

JavaScript function that returns the width of the graphics canvas

getHeight() JavaScript

JavaScript function that returns the height of the graphics canvas

Radius JavaScript

The length between the center and edge of a circle

Event JavaScript

An event is an action (such as clicking the mouse or pressing a key on the keyboard) that a program detects and uses as input.

Event

Computer General

A person or device that makes calculations, stores data, and executes instructions according to a program.

Computer

Callback Function JavaScript

A function passed as a parameter to another function in order to be called later.

Computer Science General

The study of computational thinking, the thinking humans need to in order to describe a step by step process to a computer.

Input Output (I/O) General

A general term in programming that refers to the flow of information into and out of a program

Arithmetic Operators General

Arithmetic operators include + addition, - subtraction, * multiplication, / division, and % modulus. These operators are used to perform basic mathematical tasks.

JavaScript Documentation JavaScript

Documentation for the syntax and objects in Javascript that we use on CodeHS.

javascript documentation javascript docs js documentation js docs graphics data structures

Timer JavaScript

Timers are used to used perform repeated action in a program

Timer

Animation JavaScript

Showing several still images one after another very quickly, to give the illusion of animated movement.

Randomize JavaScript

To generate or select a random object

random, randomizer

Parameter JavaScript

A variable passed in from outside the function

parameter

DRY Principle JavaScript

Don't repeat yourself: try to simplify your code and avoid repeating code unnecessarily.

dry, repeated code

Edge Case General

An edge case is a problem in your code that only occurs in extreme situations.

Edge Case

Global variable JavaScript

A variable that can be used throughout a program, in every scope

Global variable

Scope General

In what part of the program the variable exits

Scope

Counter JavaScript

A variable used to count the number of times an action has been performed

counter variable

Local variable General

A variable that is restricted to use in a certain scope of a program

Local variable

List JavaScript

Also called an array. A data structure that holds a collection of values in a particular order

List Array

Array JavaScript

Also called a list. A data structure that holds a collection of values in a particular order

List Array

Object JavaScript

Also called a dictionary or map. Lets us store pairs of keys that are matched with a specific value.

Object

Iteration General

Repetition of instructions a specified number of times, or until a condition is met.

Set JavaScript

A data structure that stores values in no particular order. Each value can only appear once in the set.

Set

Grid JavaScript

A two-dimensional array

Grid

Iterate General

A single run through the instructions contained a loop

Iterate

Return JavaScript

Exit a function and return a value

Return

Return Value JavaScript

The value returned from a function when the function is called.

Logical operator JavaScript

Used to make logical associations between boolean values

logical operator

Or operator JavaScript

Logical operator that ORs two boolean values. Written as `||`. `a || b` will be true if `a` or `b` is true.

And operator JavaScript

Logical operator that ANDs two boolean values. Written as `&&`. `a && b` will be true if both `a` and `b` are true.

Not operator JavaScript

Logical operator that negates a single boolean value. Written as `!`. `!a` will be true if `a` is false, and false if `a` is true.

Negate General

To flip a boolean value, or take the opposite of a boolean value. If you negate true, you get false. If you negate false, you get true.

Comparison operator General

Used to make comparisons between values.

comparison operator

Pseudorandom JavaScript

Not actually random, but appears to be random

Sentinel JavaScript

A constant that has the specific purpose of being the value that breaks out of a loop.

SENTINEL

Loop-and-a-half JavaScript

A loop, most often set with while(true), that has a break in the loop body.

loop and a half

break statement JavaScript

The `break;` statement breaks out of the current loop, without executing any more code in the loop.

Infinite Loop General

A loop that has no way of stopping, and will keep looping forever.

Argument JavaScript

A variable passed as a value to a function

argument