Web Design - Javascript Boolean
Web Design - Javascript Boolean
تقرير مقدم الى قسم علوم الحاسبات /كلية بغداد للعلوم االقتصادية الجامعة
اسم االستاذ
م.م .رسل مثنى
إعداد الطالبة
كوثر عباس جاسم
اسم المادة
برمجة مواقع
2020م
1.1 Introduction
Being a scripting language, JavaScript cannot run on its own. In fact, the
browser is responsible for running JavaScript code. When a user requests an
HTML page with JavaScript in it, the script is sent to the browser and it is up to
the browser to execute it. The main advantage of JavaScript is that all modern
web browsers support JavaScript. So, you do not have to worry about whether
your site visitor uses Internet Explorer, Google Chrome, Firefox or any other
browser. JavaScript will be supported. Also, JavaScript runs on any operating
system including Windows, Linux or Mac. Thus, JavaScript overcomes the
main disadvantages of VBScript (Now deprecated) which is limited to just IE
and Windows.[2]
1.3 Tools we need
To start with, you need a text editor to write your code and a browser to display
the web pages you develop. You can use a text editor of your choice including
Notepad++, Visual Studio Code, Sublime Text, Atom or any other text editor
you are comfortable with. You can use any web browser including Google
Chrome, Firefox, Microsoft Edge, Internet Explorer etc.[2]
Boolean Values
Very often, in programming, you will need a data type that can only have one of
two values, like
YES / NO
ON / OFF
TRUE / FALSE
For this, JS has a Boolean data type. It can only take the values true or false.
Boolean () Function
You can use Boolean () function to find if an expression (or a variable) is true:
[1] Goodman, Danny. JavaScript bible. John Wiley & Sons, 2007.