Published
Edited
Jul 2, 2018
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
var a
return a
}
Insert cell
{
var a // declaration
a = 10 // initialization
return a
}
Insert cell
{
var a // declaration
a = 10 // initialization
a = 111 // assigment
return a
}
Insert cell
{
var a = 10 // declaration & initialization
return a
}
Insert cell
Insert cell
{
var a = 10
var a
return a
}
Insert cell
Insert cell
Insert cell
Insert cell
{
let a
return a
}
Insert cell
{
let a // declaration
a = 10 // initialization
return a
}
Insert cell
{
let a // declaration
a = 10 // initialization
a = 111 // assigment
return a
}
Insert cell
{
let a = 10 // declaration & initialization
return a
}
Insert cell
Insert cell
{
let a = 10
let a
return a
}
Insert cell
Insert cell
Insert cell
{
const a = 10 // we must declare and initialize const at once
return a
}
Insert cell
Insert cell
{
const a = 10 // we must declare and initialize const at once
a = 111
return a
}
Insert cell
Insert cell
{
const a = 10
const a
return a
}
Insert cell
Insert cell
Insert cell
{
let helloSentence = 'Hello'
let name = 'Mateusz'
helloSentence = helloSentence + ' ' + name + '!'
return helloSentence
}
Insert cell
{
const helloSentence = 'Hello'
const name = 'Mateusz'
const helloSentenceWithName = helloSentence + ' ' + name + '!'
return helloSentenceWithName
}
Insert cell
Insert cell
Insert cell
{
const number = 1 // we can use letter
const NUMBER = 2 // JS is case sensitive!
// we can start als from $ i _
const $ = 'Ala ma kota'
const _ = 'Ala ma psa'
const $name = 'Ilona'
const _name = 'Kamila'
const numer10 = 10 // we can use numbers
const 10number // we cant start names from numbers
}
Insert cell
Insert cell
Insert cell
{
if (false){ //condition
// when condition is true
return 'Prawdziwy!'
}else{
// when condition is false
return 'Fałszywy!'
}
}
Insert cell
{
if (true){ //condition
// when condition is true
return 'Prawdziwy!'
}else{
// when condition is false
return 'Fałszywy!'
}
}
Insert cell
{
if (0){ //condition
// when condition is true
return 'Prawdziwy!'
}else{
// when condition is false
return 'Fałszywy!'
}
}
Insert cell
{
if (1111){ //condition
// when condition is true
return 'Prawdziwy!'
}else{
// when condition is false
return 'Fałszywy!'
}
}
Insert cell
{
if (""){ //condition
// when condition is true
return 'Prawdziwy!'
}else{
// when condition is false
return 'Fałszywy!'
}
}
Insert cell
Insert cell
{
if (null){ //condition
// when condition is true
return 'Prawdziwy!'
}else{
// when condition is false
return 'Fałszywy!'
}
}
Insert cell
{
if (undefined){ //condition
// when condition is true
return 'Prawdziwy!'
}else{
// when condition is false
return 'Fałszywy!'
}
}
Insert cell
{
if (NaN){ //condition
// when condition is true
return 'Prawdziwy!'
}else{
// when condition is false
return 'Fałszywy!'
}
}
Insert cell
{
if ([]){ //condition
// when condition is true
return 'Prawdziwy!'
}else{
// when condition is false
return 'Fałszywy!'
}
}
Insert cell
{
if ({}){ //condition
// when condition is true
return 'Prawdziwy!'
}else{
// when condition is false
return 'Fałszywy!'
}
}
Insert cell
Insert cell
Number('123')
Insert cell
String(123)
Insert cell
parseInt(123.4)
Insert cell
parseInt('123.4')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more