II
KENAPA BELAJAR JAVA SCRIP ??
• Gratis
• Tidak perlu Instalasi
• Hanya Butuh web browser
“JavaScripe is a high-level, scripting, untyped,
and interpreted programing language”
High- Level Language
scripting
C++ Java Flash Ms Office
ActionScripa VBScripe
C# Obj-c
Web Browser
JavaScripe
Untyped/dynamically
typed
Interpreted
“easy to learn, hard to master”
Javascripe bisa apa ?
• Client-side Web • Browser Extention /Add-on
Development • Desktop Applications
– Native Javascripe – Electron, AppJs
– Jquery • Mobile App Development
– Angular, React, Ember – Jquery mobile, Cordova
• Server-Side Development • IoT & Robotics
– NodeJs – CyclonJs, Johnny-Five
– ExpressJs • JSON
Nilai & Tipe data
• Data
• tersimpan dalam Bit
• “bit / binary digit, adalah satuan terkecil dari
data yang ada dalam komputer”
• Nilai 0/1
Bagaimana
merepresentasikan
23
Bilangan desimal
0123456789
Desimal
2 3
… 1000 100 10 1
20 3 23
Bilangan desimal 23
Bilangan biner 10111
biner
1 0 1 1 1
16 8 4 2 1
16 0 4 2 1 23
Bayangkan di dalam komputer kalian
banyaknya bit
• Untuk dapat bekerja dengan bit-bit tersebut
komputer kita sudah bisa membagi/potongan
bit-bit tersebut kedalam sebuah
• Values / nilai
• memiliki peran yang berbeda, dan peran inilah
yang kita sebut dengan
Tipe data
Tipe data
• Number
• String
• Boolean
• Object
• Function
• undefined
number
• 10
• -1500
• 3.14
string
• ‘hello world’
• “moh maulana”
Angka
• 2/0 // Infinity
• -2/0 //-Infinity
• 0/0 // Nan (Not a Number)
• 100/”apel” //Nan
• 100/”10” // 10
Operator
Membutuhkan 2 operand
Operand1 operator operand2
unary
Membutuhkan 1 operand
Operator operand
Atau
Operand operator
ternary
• Membut 3 operand
Aritmatika
+, -, *, /
%
Mod
ulus
atau
sis a ba
gi
Operator precedence
Urutan operasi matematika
KuKaBaTaKu
() * / + -
operator
Penugasan / assignment
=
=
+=
-=
*=
/=
%=
operator
Perbandingan / comparison
Menghasilkan
Boolean
True false
===
Untuk mengecek type
datanya