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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more