如何使用比较和逻辑运算符编写应用程序? [英] How do I write applications with comparison and logical operators?

查看:92
本文介绍了如何使用比较和逻辑运算符编写应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个由两部分组成的问题:



第1部分:

使用一组比较和逻辑运算符,编写一个应用程序计算结果为true并在警告框中显示结果。



第2部分:

使用一组比较和逻辑运算符,编写一个计算结果为false的应用程序并在警报中显示结果框。应用程序不能使用上一个应用程序中使用的相同运算符。



我该怎么做?



我是Javascript的新手,但我正在努力学习!谢谢!



我的尝试:



我知道怎么做去做。我是新手,但试图解决这个问题。

解决方案

part1:



var x = 15 ;

提醒(x> 10);



第2部分:



alert('yellow'==='green')&& (4> = 4);



这是正确答案吗?感谢

Here is a 2-part problem:

part 1:
Using a set of Comparison and Logical operators, write an application that evaluates to true and displays the result within an alert box.

part 2:
Using a set of Comparison and Logical operators, write an application that evaluates to false and displays the result within an alert box. The application cannot use the same operators used in the previous application.

How do I do this?

I'm new to Javascript, but I'm trying to learn! Thanks!

What I have tried:

all i know how to do. I'm new but trying to figure it out.

解决方案

part1:

var x = 15;
alert(x > 10);

part2:

alert ('yellow' === 'green') && (4 >= 4);

Would this be a correct answer? Thanks


这篇关于如何使用比较和逻辑运算符编写应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆