Sign Up

Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In


Have an account? Sign In Now

Sign In

Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Sorry, you do not have permission to add post.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Oraask Logo Oraask Logo
Sign InSign Up

Oraask

  • Write
    • Add A New Post
    • Ask A Question

Oraask Navigation

Search
Ask A Question

Mobile menu

Close
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Dev Tools
    • Online Compiler
    • Base64 Converter
  • Wiki
    • SQL Tutorials
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
Home/ Questions/Q 79236
Next
In Process

Oraask Latest Questions

Question
Hitesh
  • 0
  • 0
HiteshExplorer
Asked: April 23, 20222022-04-23T19:23:33+03:00 2022-04-23T19:23:33+03:00In: JavaScript

How to Print to Console in Javascript

  • 0
  • 0
How to Print to Console in Javascript
1
  • 1 1 Answer
  • 78 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    Related Questions

    • Set form control value in angular
    • How do I append more elements after clicking in react
    • How can we add margin left to badge in Angular material
    • How can we add bootstrap to Angular project
    • How to bound a state variable to a field react final form

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. srikanth tekumudi
      srikanth tekumudi Junior < Frontend Developer at Phenom /> || Mock Interviewer || Javascript || to teach React || Content Creator
      2022-06-27T20:25:37+03:00Added an answer on June 27, 2022 at 8:25 pm

      There are various ways to to console info.

      Here are some important methods of console API

      console.log()

      console.log(123); //number 
      console.log("Hello World!"); //string 
      console.log(10 + 20); //expression 
      console.log(new Date()); //object

      console.clear()

      console.log(10); 
      
      console.log("Hello World!"); 
      
      console.clear(); console.log("All above logs cleared");

      console.error()

      let num1 = 10, num2 = 0;
      if (num2 !== 0) {
      console.log(num1 / num2);
      }
      else {
      console.error("divided by 0");
      }

      console.assert()

      console.assert(false, "Statement is false"); 
      
      var num = 10; console.assert(num > 20, "Number is less than 20"); 
      
      console.assert(25 === '25', "25 is not equal to '25'", { "SomeObject": 12345 });

      console.table() :

      const arr = ["a", "b", "c", "d", "e"];
      console.table(arr);
      const user = {
      name: "Henry",
      id: "iuA98",
      age: 22
      }
      console.table(user);
      o/p: user info in table format

      console.time() and console.timeEnd()

      console.time("trackLoop"); 
      
      for (let i = 0; i < 10000; i++) { } 
      
      console.timeEnd("trackLoop");
      
      0/p: trackerLoop - 1ms

       

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    Adv 250x250

    Explore

    • Categories
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Dev Tools
      • Online Compiler
      • Base64 Converter
    • Wiki
      • SQL Tutorials
      • Java Tutorials
      • Python Tutorials
      • JavaScript Tutorials

    Footer

    Oraask

    About

    Oraask is a website for developers and software engineers who want to learn new skills, share their knowledge, and solve their coding problems. Oraask provides free content on various programming languages and topics, such as Oracle, Python, Java, etc. Oraask also allows users to ask questions and get answers from other members of the community.

    About Us

    • About Us
    • Contact Us

    Legal Stuff

    • Privacy Policy
    • Terms & Conditions

    Follow

    Oraask is licensed under CC BY-NC-SA 4.0Oraask CopyrightOraask CopyrightOraask CopyrightOraask Copyright

    © 2019 Oraask. All Rights Reserved
    With Love by Oraask.

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.