Tampa Devs Quiz Challenge

Created by: @haridira

Let's see how fast you are in solving these coding questions!

👁 Public

Tagged as: Quickz!, Computer Programming

History:

  • Last updated last year
  • Created last year

Played 2 times

Practiced 14 times

Host Practice
varun

thanks for using quickz!

varun - last year
View all comments
In JavaScript, what would be the result of the following statement: 1 + 3 + " dozen of eggs"?
// → 3 dozen of eggs
// → 4 dozen of eggs
undefined. An exception is thrown
// → 13 dozen of eggs

JavaScript is a *loosely* typed language. You can get away with mixing different types and JavaScript can handle the conversion for you. In this case, the numbers are indeed summed first. However, they are automatically converted into a string when added to the string value following them, and the eventual result is a strong.

In an HTML document, it is best practice to always place script tag:
Within the body tag, in the very end
In the header section (preferably the beginning of it so that body section has the code ready to use upon load)
None of these answers, because it is highly situational
Within the body tag, in the very beginning

It is always best practice to place the script in the end of the body section to ensure that the HTML elements have been loaded before adding functionality to them.

What is the expected outcome of the following statement in JavaScript: Symbol('square') === Symbol('square')?
Doesn't run because of compiler error
// → Symbol(square)
// → false
// → true

A symbol is different from a string value in that it is a unique identifier; every symbol returned by Symbol() is unique.

Inside which HTML element do we put the JavaScript?
<script>
<logic>
<javascript>
<js>
In JavaScript, what would be the result of the following statement : console.log(typeof"x")?
// → string
// → number
// → 0
Throws error “ReferenceError: x is not defined”

This is the same as asking by typing typeof("x") but JavaScript won't be upset by omitting the parenthesis in this case. And obviously the result would be 'string' we're asking about the type of a... wait for it... a string.