JavaScript Operatörler
Operatörler değişkenler üzerinde çalışmak için kullanılırlar.
Aritmatik Operatörler
| Operatör |
Tanım |
Örnek |
sonuç |
| + |
Toplama |
x=2 x+2 |
4 |
| - |
Çıkarma |
x=2 5-x |
3 |
| * |
Çarpma |
x=4 x*5 |
20 |
| / |
Bölme |
15/5 5/2 |
3 2.5 |
| % |
Modul (bölümden kalan) |
5%2 10%8 10%2 |
1 2 0 |
| ++ |
Artma |
x=5 x++ |
x=6 |
| -- |
Azaltma |
x=5 x-- |
x=4 |
Atama Operatörleri
| Operatör |
Örnek |
Benzeri |
| = |
x=y |
x=y |
| += |
x+=y |
x=x+y |
| -= |
x-=y |
x=x-y |
| *= |
x*=y |
x=x*y |
| /= |
x/=y |
x=x/y |
| %= |
x%=y |
x=x%y |
Karşılaştırma Operatörleri
| Operatör |
Tanım |
Örnek |
| == |
eşittir |
5==8 false döner |
| != |
eşit değildir |
5!=8 true döner |
| > |
büyüktür |
5>8 false döner |
| < |
küçüktür |
5<8 true döner |
| >= |
büyük eşittir |
5>=8 false döner |
| <= |
küçük eşittir |
5<=8 true döner |
Mantıksal operatörler
| Operatör |
Tanım |
Örnek |
| && |
ve |
x=6 y=3
(x < 10 && y > 1) true döner |
| || |
veya |
x=6 y=3
(x==5 || y==5) false döner |
| ! |
değil |
x=6 y=3
!(x==y) true döner |
String Operatörü
Bir string çogunlukla metindir.Örneğin "Merhaba dünya!".
İki veya daha fazla string değişkeni birleştirilirken + operatörü kullanılır.
txt1="Ne güzel"
txt2="bir gün!"
txt3=txt1+txt2 |
Şimdi txt3 değişkeni "Ne güzelbir gün!" ifadesini içeriyor.
İki string arasına boşluk eklemek için; boşluk karakterini ifadenin ortasına
VEYA birinci stringe ekleyiniz.
txt1="Ne güzel"
txt2="bir gün!"
txt3=txt1+" "+txt2 or txt1="Ne güzel "
txt2="bir gün!"
txt3=txt1+txt2 |
Şimdi txt3 değişkeni "Ne güzel bir gün!" ifadesini içeriyor.
Product Spotlight
Want To Be A Web Master?
If you want to be a Web Master, you will have to host your web
site with an ISP (Internet Service Provider).
Maximum ASP is a service provider with a unique web hosting
platform designed specifically for serious Microsoft developers.
They offer high performance and stability at a good price with a
30-day, money-back guarantee.
They have access to all of Microsoft's web technologies, and
their support staff are 100% Microsoft-certified.
Visit MaximumASP
We Help You For Free. You Can Help Us!
Jump to: Top of Page or HOME or Printer
friendly page
What Others Say About Us
Does the world know about us? Check out these places:
Google Yahoo Alta Vista MSN Lycos Excite Ask Jeeves HotBot
W3Schools is for training only. We do not warrant the correctness
of the content. The risk of using it remains entirely with the user.
While using this site, you agree to have read and accepted our terms of
use and privacy
policy.
Copyright
1999-2005 by Refsnes Data. All Rights Reserved.
|