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

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

srikanth tekumudi

Junior< Frontend Developer at Phenom /> || Mock Interviewer || Javascript || to teach React || Content Creator
Ask srikanth tekumudi
102 Visits
3 Followers
0 Questions
Home/ srikanth tekumudi/Answers
  • About
  • Questions
  • Answers
  • Best Answers
  • Posts
  • Polls
  • Asked Questions
  • Followed
  • Favorites
  • Comments
  • Followers Questions
  • Followers Answers
  • Followers Posts
  • Followers Comments
  1. Asked: April 23, 2022In: JavaScript

    How to Print to Console in Javascript

    srikanth tekumudi
    srikanth tekumudi Junior < Frontend Developer at Phenom /> || Mock Interviewer || Javascript || to teach React || Content Creator
    Added 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!");Read more

    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

     

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  2. Asked: April 23, 2022In: JavaScript

    What Does NaN Mean in Javascript

    srikanth tekumudi
    srikanth tekumudi Junior < Frontend Developer at Phenom /> || Mock Interviewer || Javascript || to teach React || Content Creator
    Added an answer on June 23, 2022 at 1:11 pm
    This answer was edited.

    NaN is Not-A-Number. There are five different types of operations that return NaN:Number cannot be parsed (e.g. parseInt("blabla") or Number(undefined))Math operation where the result is not a real number (e.g. Math.sqrt(-1))Operand of an argument is NaN (e.g. 7 ** NaN)Indeterminate form (e.g. 0 * IRead more

    NaN is Not-A-Number.

    There are five different types of operations that return NaN:
    Number cannot be parsed (e.g. parseInt(“blabla”) or Number(undefined))
    Math operation where the result is not a real number (e.g. Math.sqrt(-1))
    Operand of an argument is NaN (e.g. 7 ** NaN)
    Indeterminate form (e.g. 0 * Infinity, or undefined + undefined)
    Any operation that involves a string and is not an addition operation (e.g. “foo” / 3)

    ex:

    isNaN(NaN); // true

    isNaN(Number.NaN); // true NaN === NaN; // false Number.NaN === NaN; // false

    What is the type of NaN?

    The type of NaN, which stands for Not a Number is, surprisingly, a number. The reason for this is, in computing, NaN is actually technically a numeric data type. However, it is a numeric data type whose value cannot be represented using actual numbers

    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  3. Asked: April 23, 2022In: JavaScript

    How to Convert Set to Array in Javascript

    srikanth tekumudi
    srikanth tekumudi Junior < Frontend Developer at Phenom /> || Mock Interviewer || Javascript || to teach React || Content Creator
    Added an answer on June 21, 2022 at 3:31 pm

    There are 3 ways to convert set to array: Method 1: using spread operator let myset =new Set([1,2,3,4,5]) let myarr=[...myset] console.log(myarr) Method 2: using Array.From() let myset =new Set([1,2,3,4,5]) const myarr = Array.from(myset); console.log(myarr) Method 3: using for loop let myset =new SRead more

    There are 3 ways to convert set to array:

    Method 1:

    using spread operator

    let myset =new Set([1,2,3,4,5])
    
    let myarr=[...myset]
    
    console.log(myarr)

    Method 2:

    using Array.From()

    let myset =new Set([1,2,3,4,5])
    
    const myarr = Array.from(myset);
    
    console.log(myarr)

    Method 3:

    using for loop

    let myset =new Set([1,2,3,4,5])
    
    const myarr = []
    
    myset.forEach(x=>myarr.push(x))
    
    console.log(myarr)
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  4. Asked: June 18, 2022In: JavaScript

    What is innerhtml in javascript

    srikanth tekumudi
    srikanth tekumudi Junior < Frontend Developer at Phenom /> || Mock Interviewer || Javascript || to teach React || Content Creator
    Added an answer on June 21, 2022 at 8:40 am
    This answer was edited.

    InnerHTML is a property of every element. It tells you what is between the starting and ending tags of the element, and it also let you sets the content of the element. innerHTML will show the value and apply any HTML formatting. Ex: HTML: <div id='content'> Hi this is awesome </div> js:Read more

    InnerHTML is a property of every element. It tells you what is between the starting and ending tags of the element, and it also let you sets the content of the element.

    innerHTML will show the value and apply any HTML formatting.

    Ex:

    HTML:

    <div id='content'> Hi this is awesome </div> 

    js:

    let ele= document.getElementById('content') ele.innerHTML='<h1>text changed </h1>' 

    ouput:

     text changed 

    (in h1 style) innerHTML apply any HTML formatting in string.

    InnerText:

    InnerText wont apply HTML formatting

    ex:

    let ele= document.getElementById('content') 
    ele.innerText='<h1>text changed </h1>' output: <h1>text changed </h1> (html formatting will not apply here. It is interpreted as String only)
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  5. Asked: June 13, 2022In: JavaScript

    How to empty an array in JavaScript

    srikanth tekumudi
    srikanth tekumudi Junior < Frontend Developer at Phenom /> || Mock Interviewer || Javascript || to teach React || Content Creator
    Added an answer on June 21, 2022 at 7:32 am
    This answer was edited.

    There are  4 ways to empty array: method 1 (set length of variable as 0) ex: let arr=[1,2,3,4,5,6] arr.length=0 console.log(arr) output: [] Method 2 (Assign empty array to variable) ex:  let arr=[1,2,3,4,5,6] arr=[]; console.log(arr) output: [] Method 3 (Using splice) let arr=[1,2,3,4,5,6] arr.splicRead more

    There are  4 ways to empty array:

    method 1 (set length of variable as 0)

    ex:

    let arr=[1,2,3,4,5,6] 
    
    arr.length=0 
    
    console.log(arr)
    output: []

    Method 2 (Assign empty array to variable)

    ex: 

    let arr=[1,2,3,4,5,6]
    arr=[];
    console.log(arr)
    output:
    []

    Method 3 (Using splice)

    let arr=[1,2,3,4,5,6] 

    arr.splice(0,arr.length)

    console.log(arr)

    output:

    []

     

    Method 4 (by popping)

    let arr=[1,2,3,4,5,6]
    while(arr.length > 0) {
    arr.pop();
    }
    
    console.log(arr)
    
     output: []
    See less
      • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  6. Asked: June 18, 2022In: JavaScript

    How do I convert Javascript object to json

    srikanth tekumudi
    srikanth tekumudi Junior < Frontend Developer at Phenom /> || Mock Interviewer || Javascript || to teach React || Content Creator
    Added an answer on June 18, 2022 at 1:00 pm
    This answer was edited.

    short answer:  use JSON.stringify() There are 3 ways to use this: JSON.stringify(value, replacer)JSON.stringify(value)JSON.stringify(value, replacer)JSON.stringify(value, replacer, space) Below is demonstration JSON.stringify(value)// convert obj to jsonex:let obj={"name": "srikanth", age:26, phoneNRead more

    short answer: 

    use JSON.stringify()

    There are 3 ways to use this:

    JSON.stringify(value, replacer)

    JSON.stringify(value)
    JSON.stringify(value, replacer)

    JSON.stringify(value, replacer, space)

    Below is demonstration

    JSON.stringify(value)
    // convert obj to json
    ex:
    let obj={"name": "srikanth", age:26, phoneNo:9321234576}
    let jsonObj=JSON.stringify(obj)
    console.log(jsonObj)

    output:
    {“name”:”srikanth”,”age”:26,”phoneNo”:9321234576}

     

    JSON.stringify(value, replacer)
    ( to select keys in object)

    let obj={"name": "srikanth", age:26, phoneNo:9321234576}

    let jsonObj=JSON.stringify(obj,["name","age"])
    console.log(jsonObj)

    output:
    {“name”:”srikanth”,”age”:26}

    JSON.stringify(value, replacer, space)
     (to format output of stringified json)

    let obj={"name": "srikanth", age:26, phoneNo:9321234576}
    let jsonObj=JSON.stringify(obj,null,' ')
    console.log(jsonObj)

    output:
    {
    “name”: “srikanth”,
    “age”: 26,
    “phoneNo”: 9321234576
    }

    See less
      • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp

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.