2015년 8월 30일 일요일

Javascript Expression and Operators

Let's see Javascript expression and operator. You can learn the basic content from MDN's  Expressions and Operators . We'll see Javascript specific things and something is good to know. Learning test is written using Jasmine. Please refer Jasmine usage which I wrote before if you have interest it. 

1. equal, strict equal
If the type is different like [line5], Javascript try to converting type automatically since javascript is dynamic typing language. If you want to check equality with the actual type, you can use strict equal operator like [line 7].
2. negation, plus
The plus(+) operator convert to number.
3. string operator
4. delete operator
The "delete" operator delete specific property of object or specific index of array. The deleted object would be undefined like [line 9, line 15].
5. typeof
You can know the type using "typeof" operator.
6. void(expression)
The "void" operator evaluates expression like [line 5]. But don't return anything like [line6].
7. in operator
The "in" operator check whether specific element is contained in Object or Array.

8. Reference
- MDN - https://developer.mozilla.org/en/docs/Web/JavaScript
- Jasmine - http://jasmine.github.io/2.3/introduction.html


댓글 없음:

댓글 쓰기