Skip to main content

Apa Itu JavaScript

JavaScript merupakan bahasa pemrograman client side yang wajib dimengerti oleh pengembangan web. JavaScript membuat website yang Anda buat menjadi lebih interaktif. JavaScript membuat website seakan-akan berinteraksi langsung dengan pengguna website.

JavaScript merupakan bahasa pemrograman yang berjalan di client-slide, yaitu perangkat lunak browser. Hampir semua peranglak lunak browser saat ini mendukung JavaScript, seperti Internet Explorer, Mozila FireFox, Google Chrome, Opera dan lain-lain



Berikut adalah keungulan dari JavaScript 

  1. Ukuran file kecil karena Script dari javascript memiliki ukuran yang kecil sehingga ketika web yang memiliki javascript ditampilkan di browser maka akses tampilannya akan lebih cepat dibandingkan ketika browser membuka suatu web yang memiliki script java. Hal ini juga sangat berkepentingan dengan daya kerja server. Semakin kecil space suatu web yang disimpan dalam suatu server maka daya kerja server ketika di browsing oleh user di internet akan tidak terlalu berat, selain itu sifat javascript client side yang tidak perlu lagi di olah oleh server ketika browser memanggil web dari sebuah server. 
  2. Mudah untuk dipelajari karena Javascript merupakan bahasa semi pemograman yang merupakan gabungan antara bahasa pemograman java dengan bahasa kode HTML sehingga disebut bahasa hybrid. Walaupun javascript merupakan turunan dari java namun javascript tidak memiliki aturan yang serumit java.
  3. Terbuka karena Javascript tidak terikat oleh hardware maupun software tertentu bahkan system operasi seperti windows maupun unix. Karena ia bersifat terbuka, maka ia dapat dibuat maupun di baca di semua jenis komputer.


Berikut adalah kekurangan dari JavaScript
Penggunaan JavaScirpt dapat dicopy langsung melalui web browser, sehingga setiap orang dapat menggunakan program JavaScript yang telah anda kita buat.


Ciri-ciri JavaScript
1. Extension file berupa “.js” contoh : “app.js”
2. Case sensitive
3. Tiap akhir perintah diakhiri dengan tanda “;”
4. Diawali dengan tanda 

“<script type=’text/javascript’>’” atau “<script>” dan diakhiri dengan tanda “</script>”

5. Saling berkaitan dengan script HTML


sumber : ebook Bimboo
oleh Zaini Jam’athsani

Comments

Popular posts from this blog

About Comment In Programming

Comments are statements that will not be executed by the interpreter, comments are used to mark annotations for other programmers or small descriptions of what your code does, thus making it easier for others to understand what your code does. In Javascript, comments can be written in 2 different ways: 1. Line starting with //: // This is a comment, it will be ignored by the interpreter var a = "this is a variable defined in a statement" ; 2. Section of code starting with /*and ending with */, this method is used for multi-line comments: /* This is a multi-line comment, it will be ignored by the interpreter */ var a = "this is a variable defined in a statement" ; source : gitbook "learn javascript"

About Type In Programming

Computers are sophisticated and can make use of more complex variables than just numbers. This is where variable types come in. Variables come in several types and different languages support different types. The most common types are: Float: a number, like 1.21323, 4, -33.5, 100004 or 0.123 Integer: a number like 1, 12, -33, 140 but not 1.233 Numbers String: a line of text like "boat", "elephant" or "damn, you are tall!" Boolean: either true or false, but nothing else Arrays: a collection of values like: 1,2,3,4,'I am bored now' Objects: a representation of a more complex object null: a variable that contains null contains no valid Number, String, Boolean, Array, or Object undefined: the undefined value is obtained when you use an object property that does not exist, or a variable that has been declared, but has no value assigned to it. JavaScript is a “loosely typed” language, which means that you don't have to explicitly declar...

About Equality in Programming

Programmers frequently need to determine the equality of variables in relation to other variables. This is done using an equality operator.+ The most basic equality operator is the == operator. This operator does everything it can to determine if two variables are equal, even if they are not of the same type. For example, assume: var foo = 42 ; var bar = 42 ; var baz = "42" ; var qux = "life" ; foo == bar will evaluate to true and baz == qux will evaluate to false, as one would expect. However, foo == baz will also evaluate to true despite foo and baz being different types. Behind the scenes the == equality operator attempts to force its operands to the same type before determining their equality. This is in contrast to the === equality operator. The === equality operator determines that two variables are equal if they are of the same type and have the same value. With the same assumptions as before, this means that foo === bar will still evaluate to t...