Posts

Showing posts from March, 2023

Java script operators

     Operators are used to perform mathematical, logical operations on variables. In javascript,it has many categories. They are listed below. 1.        Arithmetic operators 2.        Logical operators 3.        Bitwise operators 4.        comparison operators 5.        Assignment operators 6.        Others.   1.         1.  Arithmetic operators:      This is basic operator   which is used to perform arithmetic operations like addition, subtraction and so on. Operator Meaning Usage + Addition a+b ,a+50 - Subtraction a-b, a-10 * Multiplication a*b / Division a/b ...

Datatypes and Variables in java script

Image
Datatypes are used to hold the values of variables. JavaScript has two types of datatypes. ·        Primitive data types ·        Non-primitive data types Java script is a dynamic type. It is not important to mention the datatype earlier. Use “var” for variable. Primitive data types: Javascript has 5 primitive data types. They are listed below. Boolean : it represents zero or one value. Number : it represents numbers. String :it represents sequence of characters. Null : it represents no value. Undefined: if you want to define the value later, use this data type. Non- primitive data types: Javascript has 3 different types of non-primitive data types. They are given below. Array : It has a list of similar values Object : it is a instance of a class. Regexp : It is for Regular Expressions.   Variables:   Variables are so important for any language. It specifies the value. In javascri...

Different types of messages displaying in java Script -Full stack development

Image
  Html uses script tag to include java script coding. The user can include the scripting in any part of html. It can be in <head> tag part , <body> tag part or as a external file. Here, three different examples for message displaying are given. à Displaying a simple message ·          Create a file in notepad and name it as “Message.html” ·        Next, Type the following code. <!DOCTYPE html> <html> <head> <title> Simple message</Title> </head> <body> <script language="javascript" > document.write("Have a pleasant Day") </script> </body> </html> ·        Open the file in your web browser. ·        It shows the output.   è   à Display birthday message using command button    ...