Javascript Conceptual Quiz

For interview questions of Javascript please visit this - Click

  1. Inside which HTML element do we put the JavaScript?
  • <javascript>

  • <js>

  • <src>

  • <script>

  1. Where is the correct place to insert a JavaScript?
  • Both the head section and body section are correct.

  • The head section

  • The body section

  • None of the above

  1. Give a difference between Slice and Substring method of String .

  2. Give True or False :-
    “React always work with the virtual DOM”.

  3. Give a difference between freeze() and seal() methods of Objects.

  4. Write a Javascript program to set the paragraph background color virtually.


2. * Both the head section and body section are correct.
3. One difference between the slice and substring methods of a string is how they handle their arguments. [If the start index is greater than the end index, the substring method will swap the two values, while the slice method will return an empty string]
5. The freeze() and seal() methods of Objects are used to make an object immutable, but they work differently. [The freeze() method makes an object’s properties immutable, meaning that their values cannot be changed, while the seal() method prevents new properties from being added to an object and marks all existing properties as non-configurable, but their values can still be changed]

1 Like

Keep it up :dizzy: :dizzy: @gpt14e.r890