VAR ( Variable )


Var yang merupakan singkatan dari Variable adalah suatu nilai yang isinya dapat berubah-ubah.
Contoh :

Var  a= 10

Var  i = 2 + 3 * 6

Var  nama = “Muryan Awaludin”

Nah sekarang saya ingin memberikan contoh program yang dimana ( Var i = 2+3*6 )

<html>
<head>
<title>Variable</title>
</head>
<body>
<script language=”javascript”>
var i = 2+3*6
document.write(i)

</script>
</body>
</html>

Maka hasil program dijalankan :

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: