1.  logic operation : '&&' and '||'  .For this two logic operations,its' results are inconclusive.the difference between this two logic operations  and others is that they don't change the data type of the operands and also don't change the data type of the operation result. In the expression , this operator(&& and ||) will understand the type of the operands as the bool type ,so they can  execute bool operation.you can have a look below.

 <html>
<head>
<meta http-equiv="content-type" charset="utf-8"/>
<script type="text/javascript">
var str = "hello";
var obj = {};
alert(str || obj);//str as string type ,obj as an object,return str("hello")
alert(str && obj);//return obj
alert(undefined || 123);//undefined as false,and return 123
</script>
</head>
<body>
</body>
</html>

2.  comparison operation. For comparing two value type data,generally just compare their values.For comparing a value type data and a reference type data,first switch the reference type data to the same type as the value type data,then compare them.For comparing two reference type data,it's unmeaning and always return false.like below:

 <html>
<head>
<meta http-equiv="content-type" charset="utf-8"/>
<script type="text/javascript">
var o1 = {};
var o2 = {};
var str = "123";
var num = 1;
var b0 = false;
var b1 = true;
var ref = new String(); alert(b1 < num);//return false;
alert(b1 <= num);//return true;
alert(b1 > b0);//return true; alert(num > ref);//return true; alert(o1 > o1 || o1 < o2 || o1 == o2);//always return false;
</script>
</head>
<body>
</body>
</html>

Javascript Basic Operation Extraction的更多相关文章

  1. matlab basic operation command

    Matlab basic operation: >> 5+6 ans = 11 >> 3*4 ans = 12 >> 2^6 ans = 64 >> 1 ...

  2. 【MongoDB】The basic operation of Index in MongoDB

    In the past four blogs, we attached importance to the index, including description and comparison wi ...

  3. JavaScript Basic

    Exercise-1 Write a JavaScript program to display the current day and time in the following format. T ...

  4. Basic Operation about Linux

    1. 永久开启/关闭防火墙 在linux中防火墙是一个名叫iptables的工具 开启: chkconfig iptables on 关闭: chkconfig iptables off 即时生效,重 ...

  5. mysql basic operation,mysql总结

    mysql> select * from wifi_data where dev_id like "0023-AABBCCCCBBAA" ; 1.显示数据库列表.show d ...

  6. HDFS Basic Operation

    1.如何启动一个命令行的hadoop客户端 任何一个Hadoop集群中的节点,只要有hadoop安装包,就可以通过# hadoop fs来启动 2.Hadoop基本命令格式 # hadoop  fs  ...

  7. JavaScript Basic Memo

    1.this 的指向 1).由 new 调用?绑定到新创建的对象. 2). 由 call 或者 apply(或者 bind)调用?绑定到指定的对象. 3). 由上下文对象调用?绑定到那个上下文对象. ...

  8. Chapter 2 JavaScript Basic

    Has 5 primitive types: Undefined, Null, Boolean, String, Number. typeof  operator Undefined return u ...

  9. mysql basic operation,mysql总结,对mysql经常使用语句的详细总结,MySQL学习笔记

    mysql> select * from wifi_data where dev_id like "0023-AABBCCCCBBAA" ; 1.显示数据库列表.show d ...

随机推荐

  1. Django处理文件上传File Uploads

    HttpRequest.FILES 表单上传的文件对象存储在类字典对象request.FILES中,表单格式需为multipart/form-data <form enctype="m ...

  2. minitools

    1.android 2.linux 3.luoji 4.windows CE ----

  3. Windows 各种计时函数总结

    本文对Windows平台下常用的计时函数进行总结,包括精度为秒.毫秒.微秒三种精度的 5种方法.分为在标准C/C++下的二种time()及clock(),标准C/C++所以使用的time()及cloc ...

  4. JPA详解

    2006 年 5 月 2 日,EJB 3.0 规范最终版由 JCP(Java Community Process) 正式公布,标准号为 JSR(Java Specification Request)2 ...

  5. MAX-HEAPIFY(2/3n的疑惑)

    Q: In CLRS, third Edition, on page 155, it is given that in MAX-HEAPIFY, The children’s subtrees eac ...

  6. [LOJ 1038] Race to 1 Again

    C - Race to 1 Again Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu D ...

  7. 【转】iOS 宏(define)与常量(const)的正确使用-- 不错

    原文网址:http://www.jianshu.com/p/f83335e036b5 在iOS开发中,经常用到宏定义,或用const修饰一些数据类型,经常有开发者不知怎么正确使用,导致项目中乱用宏与c ...

  8. jQuery遍历DOM

    jQuery提供了多种遍历DOM的方法.遍历方法中最大的种类是树遍历. 向上遍历DOM树 parent():返回被选元素的直接父元素 parents():返回被选元素的所有祖先元素,它一直遍历到根元素 ...

  9. android利用WebView实现浏览器的封装

    android提供了封装浏览器的接口,可以让开发者利用自己的view显示网页内容.今天又实现研究了一下,利用WebView显示浏览器内容,还可以利用 WebViewClient显示自己需要的内容. 参 ...

  10. 求大于整数m且紧靠m的k个素数 及 判断一个数是否为素数的方法

    题目: 请编写一个函数void fun(int m,int k ,int xx[]),该函数的功能是:将大于整数m且紧靠m的k个素数存入xx所指的数组中. 例如,若输入:17,5,则应输出:19,23 ...