answersLogoWhite

0

To test if two number are equal in JavaScript, we use the == operator and compare them. The below function test if two number (a and b) are equal. The function returns 1 if a is greater, -1 if b is greater, and 0 if the numbers are of equal value.

function isEqualTo( a, b ){

if ( a > b ){

return 1;

}

if (b > a ){

return -1;

}

return 0;

}

User Avatar

Wiki User

∙ 13y ago

What else can I help you with?

Related Questions

What program code is the easiest to learn?

Most likely java script


What is used to create large program on internet?

Java script


Is Java script needed for Poptropica?

No, Java script is not needed to play poptropica.


Does a java script operator perform mathematical operation on 2 numbers?

some times


What is java fx2.1.1?

Java script


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


What Program that will display the even numbers in data structures and algorithms?

JAVA


Is there a program that will automatically translate script I'm looking for something that can show me the script on one side and the meaning of the script on the other side especially java?

That is called IDE (Integrated Development Environment). That is a standard tool to see the code-behind and the outcome. For JAVA there is netbeans & eclipse which are popular & free.


How do you open java script?

You need to have some program that can open/run them on your computer. To save them, then run them, save them as a .Js files.


Which operator is used in java script to work on string?

If you want to check if two strings are equal you have to use string_b)alert("Strings are equal");elsealert("Strings are not equal");}


Does Java Script use the same compiler as Java?

No


Does java script coding mean using it for Java programs only?

No. JavaScript coding does not mean writing programs only for Java. JavaScript and Java are two different programming languages. JavaScript is mainly used to create interactive websites and web applications, such as menus, forms, animations, online shopping features, and dashboards. It can also be used for server-side development, mobile apps, desktop applications, and more. In simple terms: Java is a programming language, while JavaScript is primarily a web-development language. Despite their similar names, they are not the same. visit now : Excellence Technology 9317788822, 9357788822