LEARNING CONSOLE COMMANDS! - JavaScript Tutorial for KIDS! - Ep. 3

TheJavaKidd · Beginner ·🧒 Coding for Kids ·4mo ago

Key Takeaways

This video tutorial covers the basics of JavaScript console commands for kids, including console.log, console.error, and console.warn. The instructor demonstrates how to use these commands in a JavaScript scratch pad to log messages, generate errors, and display warnings.

Full Transcript

how long am I really this is with Java kid with another JavaScript for kids video today in this JavaScript video we'll be looking into the JavaScript console to use a few simple console command so let's jump right into it what you want to do here is right click inspect your only course is always go over here to console because we will be using it now and open up the JavaScript scratch pad which is this icon right over here so just open it up put it on desktop and okay so what we'll be doing today is pretty simple we're going to be using this thing right here this is the JavaScript console and we use for some console commands that we will be learning today so those console commands are going to be console that law which logs something to the console also that error which self generates an error to the console and called full dot warned which generates a warning to the console so let's go to our scratch right here delete this generated text and let's get into it okay so the first command is going to be called console dot log this command is actually used very quite quite quite a lot and um we're going to be using it right now so as you would expect it is console log for an elf fantasy don't forget the semicolon guys if you do the world could explode something could happen so never forget to put the parentheses partner semicolon at the end of you Johnson's cool okay anyway we're going to go back into our stuff and so here it is here's our command right here console dot log and let me take you step by step this tells the console that we want to do something dot log log something on to the console so what do a little up well I kind of had a log um r.i.p Han Solo cuz it was pretty sad guys anyways um after my Star Wars fantasy uh we're going to press uh run go over here and of course it says r2p Han Solo right here over here this is our console log and it logged it to the console so let's clear this right over here and just for a simple note you can also do console dot log over here um you can also do it right here it doesn't really matter where you do it I prefer scratch pad personally so of course just pops up right there delete that up wait great setup that you need anyway next console command is going to be console dot error so this um this is just something to show to you guys because of course on later uh we'll probably be having a bunch of errors and don't worry that is all part of the coding process making errors debugging your code so um I just wanted to show you guys what an error on the console looks like so you could be sort of more aware of it and you would understand it and be able to debug your code better when it comes to the time so let's go to contact our error you don't need to put anything inside of it because of course it's an error and let's run this and that is what an error looks like guys so it has these blue balls red a highlight and of course it's i showing because it is an error and if you see this in your code it all these three teams you have an error one thing to know is one thing useful to use actually is this shows or hides your the message and why the the code went wrong or why it pops up an error so right now course we generated the air so it's going to say anonymous it doesn't know why the error was caused so um yeah and what I just wanted to make you guys aware of is just to watch out for this error this kind of icon and the last command is going to be uh icons no no the last command is going to be console dot one so this usually pops up when you want to warn someone and self course you can put something or whatever text you want inside of the console dot error or the console dot warrant let's see let's put air in here and and here I have something good or something um you could put a there but here's just my text I'm going to run this and I'll show you what our warning looks like and what's some text all right so this is what a warning looks like obviously or you know what a console that log and that error looks like so this is what a warning looks like it has this triangle thing that obviously symbolizes it's a little naughty and um it has our text right here warning you're entering restricted JavaScript for kids territory parents beware and that's our text right there we just put it inside of these parentheses so yes guys these are the three console commands that we are learning in this episode if you did enjoy this video guys please do it with big fat thumbs up and if you are really awesome subscribe to my channel anyways that will do it for today guys and keep experimenting a finderscope and keep coding guys and doing it but
Sign in to unlock AI tutor explanation · ⚡30

This video teaches kids the basics of JavaScript console commands, including how to log messages, generate errors, and display warnings. The instructor demonstrates how to use these commands in a JavaScript scratch pad.

Key Takeaways
  1. Open the JavaScript scratch pad
  2. Use console.log to log a message
  3. Use console.error to generate an error
  4. Use console.warn to display a warning
  5. Experiment with different console commands
💡 Console commands are useful for debugging and logging messages in JavaScript code.

Related Reads

Up next
Robotics Workshop at IST Hyderabad | Coding to Real-World Applications | Intellipaat School
Intellipaat
Watch →