Skip to content

Glossary

Ben Foley edited this page Jul 31, 2019 · 22 revisions

BTW, the linked JS Bin code examples work best in Chrome or Firefox, not so good in Safari.

Table of Contents

Coming soon

  • state
  • props
  • properties
  • synchronous, asynchronous


command

A command is an instruction that is used to control a computer program/script/application. The command is typically typed into a terminal.


components

Components are the building blocks of React apps, they are classes that might have data inputs and are rendered to create UI elements.

Here's an example of a simple "functional" component, written in concise fat-arrow style.

const Name = () => <h1>Ben</h1>

Here's another example, this is a "class" or "stateful" component.

import React, { Component } from 'react'
class App extends Component {
  render = () => {
    return (
      <div>Ben</div>
    )
  }
}
export default App

See the workshop on components for full examples and detailed description of the differences between functional and stateful components. TODO hasn't been written yet, watch this space.


object property value shorthand

This is a concise way to set an object's properties (see the Javascript page for more details about objects), that can be used when you have the property value in a variable named the same as the property key. Run this in JS Bin

const name = "ben"
const diet = "anything"
// regular way
let person = {"name":name, "diet":diet}
// shorthand way
person = {name, diet}
console.log(person)

object spread

This is a concise way to clone an object, particularly handy when you want a copy of an object, but change one or more of its properties. Run this in JS Bin

const person = {
  name: "ben",
  location: "beach",
  diet: "cabbage"
}

const newPerson = { ...person, diet: "bananas" }

console.log(person)
console.log(newPerson)

tag

A tag is a bit of HTML code that provides structure to content. Tags are (generally) written in matching pairs of opening and closing parts, and they can have extra attributes and values. Here's an example of a paragraph tag.

<p>some content goes between the tags</p>

This paragraph tag has an attribute named class which has a value of important.

<p class="important">some content</p>

terminal

When you use an application like Word, you are using a "graphical user interface (GUI)" to do stuff to your data via menus and buttons. Another way of doing stuff with your data is by running programs that don't have a GUI, via a terminal, also known as a command line or command prompt. For Mac, there's a command line program in your Applications folder, called Terminal. To get a command line program on Windows, type command or cmd into the search field in your taskbar. Then, click or tap on the Command Prompt result.

Note: When you start your terminal, it will display a $ or > sign at the start of the line. Hence, when you see something like $ blah blah blah in the workshop steps, you don’t need to type the $ sign, just type the words in the instruction that follow it.

Clone this wiki locally