Console (कन्सोल)

In JavaScript, we use console.log() to write a message (the content of a variable, a given string, etc.) in console. It is mainly used for debugging purposes, ideally to leave a trace of the content of variables during the execution of a program.

जाभास्क्रिप्टमा, हामी कन्सोलमा सन्देश (चरको सामग्री, दिइएको स्ट्रिङ, आदि) लेख्न console.log() प्रयोग गर्दछौं। यो मुख्यतया डिबगिंग उद्देश्यहरूको लागि प्रयोग गरिन्छ, आदर्श रूपमा प्रोग्राम को कार्यान्वयनको क्रममा चरहरूको सामग्रीको ट्रेस छोड्नको लागि।

Example:

console.log("Welcome to Learn JavaScript Beginners Edition");
let age = 30;
console.log(age);

📝 Tasks:

  • [ ] Write a program to print Hello World on the console. Feel free to try other things as well!

  • [ ] कन्सोलमा 'हेलो वर्ल्ड' प्रिन्ट गर्न प्रोग्राम लेख्नुहोस् । अन्य कुराहरू पनि प्रयास गर्न स्वतन्त्र महसुस गर्नुहोस्!

  • [ ] Write a program to print variables to the console.

  • [ ] 'कन्सोल' मा चल मुद्रण गर्न प्रोग्राम लेख्नुहोस् ।

    1. Declare a variable animal and assign the dragon value to it.
    2. एक चर animal घोषणा गर्नुहोस् र यसलाई ड्रैगन मान निर्दिष्ट गर्नुहोस्।
    3. Print the animal variable to the console.
    4. कन्सोल मा animal चर मुद्रण गर्नुहोस् ।

💡 Hints:

  • Visit the variable chapter to understand more about variables.
  • चरहरूको बारेमा थप बुझ्न चर अध्यायमा जानुहोस्।

results matching ""

    No results matching ""