1. Question:What are the characteristics of JavaScript? 

    Answer
    1) JavaScript Lives in a Web Page
    2) JavaScript is not server side language. It is client side language because it is interpreted and run on the browser.
    3) It is weakly typed because it does not need to specify datatypes to declare variable (int, float, double etc) like c/c++.
    4) It is not programming language. It Interpreted language because browsers are interpret it.
    5) JavaScript is case sensitive.
    6) Semicolon(;) is optional
    7) String can be enclosed by using single quote (‘) or double quote(“”)
    8) // is used to specify single line comment and /* ... */ is used to specify multiline comment.

    1. Report
  2. Question:

    What do you mean by cookies?

     

    Answer

    Cookie:

    1. A cookie is usually a small piece of data sent from a website and stored in a user's web browser while a user is browsing a website.
    2. When the user browses the same website in the future, the data stored in the cookie can be retrieved by the website to notify the website of the user's previous activity.
    3. Cookies were designed to be a reliable mechanism for websites to remember the state of the website or activity the user had taken in the past

    The general format for setting a cookie is this:

    document.cookie=value;[expires];[path];[domain];[secure];

    1. Report
  3. Question:What is reserved word? Write five reserved word. 

    Answer

    1. Reserved words are those in JavaScript that have been reserved for statements and bulit-in functions.
    2. We should avoid creating identifier for variable and functions that are identical to JavaScript reserved word.

    Five reserved words are:

    1. function
    2. for
    3. return
    4. break
    5. continue

    1. Report
  4. Question:Write about interpreted and loosely typed language according to JavaScript? 

    Answer

    An Interpreted Language:
    The process involves by browser parsing (interpreting) the JavaScript code and then creating an equivalent machine language and execute the interpreted code.

    Loosely typed language: The language that does not require to specify the datatype (int, float, boolean, string etc.) before declaring variables.


    1. Report
  5. Question:What are the difference between alert() and prompt()? 

    Answer
    Alert(): The alert() function displays a message on the web page for the users. In this case the users need nothing to do except click to close to it.
    prompt(): The prompt() function also displays a message/statements for the users but in this the users can also input data in the input box.

    1. Report
Copyright © 2024. Powered by Intellect Software Ltd