CS 347: Lab 12 – JavaScript Questions
October 6, 2020 by Chris Johnson. Filed under
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
fall-2020, labs, webdev.
Welcome to lab, a time for applying the ideas introduced in lecture in exercises that you will complete in small groups.
Within your breakout room, designate one of your team to be the screen sharer. Screen sharer, share your screen and claim your group’s task on Crowdsource. Make sure to enter every group member’s JMU eID so that they receive credit. Your group will be assigned a task number.
Team, complete the assigned task below. Screen sharer, be careful not to dominate. All members should contribute ideas.
Task
Answer the following questions. Assemble your answers in a plain text document using your preferred method (Google Docs, Slack, Zoom chat, etc.).
- What does it mean that JavaScript is dynamically typed?
- There are three keywords to declare variables in JavaScript:
var, let, and const. What are the semantics of each? Does const mean constant? What is meant by the term hoisting?
- Why are
== and != problematic? How should comparisons be made?
- How does function overloading work in JavaScript?
- Suppose I have the following function definition:
function delay(millis) {
return new Promise(resolve => setTimeout(resolve, millis));
}
How do I schedule a JavaScript alert call to execute after 3 seconds has elapsed?
- Investigate the spread syntax of arrays. If I have arrays
a and b, how can I define a new array c using this syntax?
- What are the primitive types? Compared to other languages you know, what types are missing?
- Write a function named
each that accepts two parameters: an array and a callback function. For each element of the array, call the function with the element passed as the parameter. Use a loop; do not use any builtin array functions to achieve this. Write additional code to demonstrate that each works.
Screen sharer, when your group is done or when time is up, submit your group’s answers on Crowdsource. Do not submit a link; copy and paste the plain text content into the form.