Dashboard Hero
  • Scope
  • Introduction
    • Meet and greet
    • Requirements(tech)
    • Requirements(user)
  • Setting up
    • Developing locally
    • Deploying
  • Basics
    • Scss
    • Javascript
    • Svelte framework
    • vs React vs Angular vs vue.js
    • Rollup(and rollup.config.js)
    • NPM(and package.json)
  • Project structure
    • Overview
    • Git version
    • Folder version
  • Architecture
    • DRY vs WET programming
    • Basic
    • Extended
  • Components
    • Component lifecycle
    • Passing data between components
    • Buttons
    • Charts
    • Grids
    • Search bars
    • Other inputs
    • Dialogs
    • Dropdowns
    • Gauges
    • User management pages
  • Backend
    • Firebase cloud functions
  • Data sources
    • Firebase
    • MongoDB
    • *SQL sources
    • GraphQL
  • User management
    • Log in
    • Register
    • Forgot pass
    • Custom flows
    • Others
  • State control
    • Redux
    • MobX
    • Saga
  • Dashboard: a full project
    • Overview
    • Layout
    • Routing
    • Removing/adding pages
    • Deploying
  • Roadmap/tutorial
    • Introduction - building your own app
    • 1. UI - HTML&CSS
    • 2. Data sources(+testing)
    • 3. Defining and using existing components
    • 4. User management
    • 5. Go live!
  • Troubleshooting
    • Can't run the project
Powered by GitBook
On this page

Was this helpful?

  1. Basics

Javascript

PreviousScssNextSvelte framework

Last updated 5 years ago

Was this helpful?

We'll shed some light on some mysterious Javascript constructs that are unfamiliar when you come from a different programming language. The 3 below are everything that should suprise you, that you will find used with Dashboard Hero or in adjacent libraries.

Equality comparators

Because objects are not strongly typed, there's an equality comparator that also does type checking: ===

Quick example:

var num = 0;
var obj = new String('0');

console.log(num == obj); // true
console.log(num === obj); // false

Destructuring objects

Unpacks values from arrays.

Quick example:

[a, b] = [10, 20]; console.log(a); // expected output: 10

Three dots operator

Array comprehension utility.

Quick example:

var parts = ['shoulders', 'knees']; 
var lyrics = ['head', ...parts, 'and', 'toes']; 
// ["head", "shoulders", "knees", "and", "toes"]

Further reading
Further reading
Further reading