Added an example showing storing values in variables before adding them. Also added syntax highlighting to original code snippet.
		
			
				
	
	
		
			18 lines
		
	
	
		
			358 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			358 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ---
 | |
| title: Add Two Numbers with JavaScript
 | |
| ---
 | |
| JavaScript uses the `+` symbol for addition. It can also be used instead of `parseInt()` but that is beyond this.
 | |
| 
 | |
| ```javascript
 | |
| var sum = 10 + 10;
 | |
| ```
 | |
|     
 | |
| Variables can be added in a similar fashion.
 | |
| 
 | |
| ```javascript
 | |
| var x = 10;
 | |
| var y = 10;
 | |
| var z = x + y;
 | |
| console.log(z);    // Will print 20 to the console
 | |
| ```
 |