WorksheetsFRONTEND QUIZ
Total questions: 58
Worksheet time: 22mins
function aaa() {
return
{
test: 1
};
}
alert(typeof aaa());
What does the above alert?
User defined
Object
Number
function
Inside which HTML element do we put the JavaScript?
<script>
<javaScript>
<js>
<scripting>
Where is the correct place to insert a JavaScript?
The <head> section
The <body> section
both the <head> and <body> section are correct
Which is the correct way to write a JavaScript array?
var txt = new Array(1:"arr",2:"kim",3:"jim")
var txt = new Array:1=(" arr ")2=("kim")3=("jim")
var txt = new Array("arr ","kim","jim")
var txt = new Array=" arr ","kim","jim"
Which of the following is correct to write “Hello World” on the web page?
System.out.println(“Hello World”)
print(“Hello World”)
document.write(“Hello World”)
response.write(“Hello World”)
Which of the following is not a valid JavaScript variable name?
2java
_java_and_ java _names
javaandjava
None of the above
Why so Java and JavaScript have similar name?
Java Script is a stripped-down version of Java
The syntax of JavaScript is loosely based on Java syntax
They both support Object Oriented Programming
None of the above
How do you create a function in JavaScript?
function myFunction()
function:myFunction()
function=myFunction()
How do you call a function named "myFunction"?
call function myFunction()
call myFunction()
myFunction()
How can you add a comment in a JavaScript?
//This is comment
'This is comment
<!-- This is comment-->
How do you declare a JavaScript variable?
v carName
variable carName
var carName
Is JavaScript case-sensitive?
yes
No
Javascript is _________ language.
Programming
Scripting
Application
applet
JavaScript is ______ Side Scripting Language.
JSP
Servlet
Server
Browser
JavaScript is designed for following purpose -
To Style HTML Pages
To Perform Server Side Scripting Opertion
To add interactivity to HTML Pages.
To Execute Query Related to DB on Server
JavaScript is can be written -
directly into JS file and included into HTML
directly into HTML pages
directly on the Server Script
None of these
JavaScript is an ________ language.
compiled
interpreted
JavaScript Code is written inside file having extension __________.
.jsc
.jvs
.js
.javascript
Why JavaScript is called as Lightweight Programming Language ?
because JS can provide programming functionality inside but up to certain extend.
because JS is client side scripting
because JS is available free of cost.
because we can add programming functionality inside JS
Local Browser used for validations on the Web Pages uses __________.
HTML
CSS
js
java
JavaScript Code can be called by using _________.
RMI
Function / Method
Triggering Event
Preprocessor
Is this correct syntax to include JS Code inside HTML Page ?
<script type="text/javascript">
...
</script>
Yes
No
We cannot Place JS Code in the body tag . Say true/false.
True
False.
The CSS Property used to make the text bold is:
font-style
font-weight
font-size
font-bold
How to select the elements with their class name "container" ?
#container
container
$container
.container
What model includes margin, border, padding, and content?
CSS Box model
CSS3 Flexbox Box model
CSS3 Grid Layout model
CSS Grid Template Layout Module
Which CSS property allows you to control how the total width and height of an element is calculated?
width-height
box-dimension
box-sizing
element-sizing
Which CSS property is commonly used to horizontally center an element within its parent?
text-align
align-content
justify-content
margin: 0 auto;
In CSS, what is the difference between an ID and a class selector?
IDs are for styling multiple elements, while classes are for single elements.
IDs are for single elements, while classes are for styling multiple elements.
IDs and classes can be used interchangeably.
IDs and classes have no difference in CSS.
Which type of gradient transitions between two or more colors in a linear pattern?
Linear gradient
Radial gradient
Diagonal gradient
Circular gradient
What is the default display value for a <div> element in CSS?
inline
inline-block
block
flex
You want to ensure that an element with the class "box" has a width of 300px, including padding and border. Which CSS rule accomplishes this?
.box { width: 300px; box-sizing: content-box; }
.box { width: 300px; box-sizing: padding-box; }
.box { width: 300px; box-sizing: border-box; }
.box { width: 300px; box-sizing: margin-box; }
How can you center an element with the class "centered" both horizontally and vertically within its parent using CSS?
.centered { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.centered { position: relative; top: 50%; left: 50%; transform: translate(50%, 50%); }
.centered { position: fixed; top: 0; left: 0; margin: auto; }
.centered { display: flex; align-items: center; justify-content: center; }
Which of the following CSS declarations correctly sets the margin on all sides of an element to 10 pixels?
margin: 10px;
margin: 10px 10px;
margin: 10px 10px 10px;
margin: 10px 10px 10px 10px;
How can you horizontally center a block-level element within its parent using CSS Flexbox?
align-items: center;
justify-content: center;
align-content: center;
flex-direction: center;
What's the error in the following CSS code?
The background color is not set.
The width and height values are missing units (e.g., px).
The padding and margin values are too small.
There are no errors in the code.
How can you make a flex container arrange its items in a column layout instead of a row layout using CSS Flexbox?
direction: column;
flex-layout: column;
flex-direction: column;
layout: column;
Given the HTML and CSS code, how can you ensure the background image covers the entire element and maintains its aspect ratio?
contain
cover
fill
none
