22 lines
		
	
	
		
			921 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
		
		
			
		
	
	
			22 lines
		
	
	
		
			921 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| 
								 | 
							
								---
							 | 
						||
| 
								 | 
							
								title: Meet the Node console
							 | 
						||
| 
								 | 
							
								---
							 | 
						||
| 
								 | 
							
								## Meet the Node console
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds  -->
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								Make sure you have cloned the correct repository/glitch project and are writing your code in myapp.js. 
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								There are many methods available from the node console. You can find a list of these methods with Node.js documentation 
							 | 
						||
| 
								 | 
							
								<a href='https://nodejs.org/dist/latest-v10.x/docs/api/console.html' target='_blank' rel='nofollow'>here</a>. A common use would be to log errors such as:
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								```javascript
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    console.log("An error happened");
							 | 
						||
| 
								 | 
							
								```
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								### If you use Glitch
							 | 
						||
| 
								 | 
							
								- Glitch had changed the 'Logs' button to 'Status' button, still on the top-left, under the app name
							 | 
						||
| 
								 | 
							
								- Don't submit the 'Edit' page directly. Click the 'Show' button (on top) and submit the application show page's url (url format is like https://appname.glitch.me/)
							 | 
						||
| 
								 | 
							
								
							 |