My Java Full Stack Journey Learning in JavaScript

my-java-full-stack-journey-learning-in-javascript

Today Second day class in JavaScript. I shared the topics, What I learn Today.

Operators:
In programming and logic, an operator is a symbol or keyword that performs an action on one or more values (called operands).

Types of Operators:
.Arithmetic Operators
.Assignment Operators
.Comparison Operators
.Logical Operators
.String Operators
.Type Operators
.Ternary Operator (Conditional)
.Nullish Coalescing
.Optional Chaining

ParseInt() = method

String change into integer.

(NAN) = not a number

Arithmetic Operators:

`+`       Addition            
 `-`       Subtraction        
 `*`       Multiplication     
 `/`       Division            
 `%`       Modulus (remainder) 
 `**`      Exponentiation      
 `++`      Increment           
 `--`      Decrement           

Assignment Operators:

 `=`      
 `+=`     
 `-=`     
 `*=`    
 `/=`    
 `%=`     
 `**=`  

Comparison Operators:

`==`      Equal to (loose equality)              
 `===`     Equal value and type (strict equality)   
 `!=`      Not equal to                            
 `!==`     Not equal value or type                
 `>`       Greater than                       
 `<`       Less than                  
 `>=`      Greater than or equal               
 `<=`      Less than or equal     

Logical Operators:

&&  Logical AND 

!   Logical NOT

String Operators:

+   Concatenation   

+=  Append and assign   

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
july’s-top-product-management-reads

July’s top product management reads

Next Post
your-go-to-market-cheat-sheet

Your go-to-market cheat sheet

Related Posts
5章5

5章5

このJavaコードのスニペットには、ItemクラスとMainクラスの2つのクラスが含まれています。ItemクラスにはnameというString型の変数とpriceというint型の変数があり、priceは100に初期化されています。 Mainクラスにはmainメソッドがあり、ここでプログラムが実行されます。mainメソッドはItemオブジェクトの配列itemsを作成し、その長さを3に設定します。その後、整数型の変数totalを0で初期化し、forループを使用して各Itemオブジェクトのpriceをtotalに加算します。 しかし、このコードにはItemオブジェクトを実際にitems配列に割り当てるコードがありません。つまり、items配列にはデフォルトでnullが設定されているため、Itemのインスタンスが存在せず、items[i].priceを参照しようとするとNullPointerExceptionが発生します。 そのため、選択肢E「実行時に例外がスローされる」という答えが正しいです。Itemオブジェクトがitems配列に割り当てられていないため、forループの実行時にnullのpriceにアクセスしようとして例外がスローされます。 コードにコメントを加えて説明すると以下のようになります: public class Item { String name; // 商品名を保存する変数 int price = 100; //…
Read More