Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

answer both question. plz do not take/ submit this assignment if you don't know the answer. do it as soon as possible. thanks in advance.best

answer both question. plz do not take/ submit this assignment if you don't know the answer. do it as soon as possible.
thanks in advance.best of luck. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Question 4 Given this code sample: user - IsWizard: true, height: 5, name: Harry user21 iswizard: true height: 6, name: 'Voldemort if(/" if statement condition goes here */)) Which of the following if statement conditions can best be used to translate the following phrase from English into Javascript? If user is a Wizard and either user2 is a Wizard or user has name equal to Harry Select the best answer. user.isWizard && user2.isWizard | user.name "Harry (user.isWizard && user2.is Wizard) || user name 'Harry user.isWizard && (user.isWizard | user.name == "Harry) Which of the following if statement conditions can best be used to translate the following phrase from English into Javascript? If use is a Wizard and either user2 is a Wizard or user has name equal to Marry Select the best answer. user.is Wizard && user2.is Wizard | username == "Harry (user.isWizard && user.isWizard) || user.name == 'Harry O user.isWizard && (user.isWizard | user.name == "Harry) user2.isWizard && user.isWizard | user2.name == 'Harry O user.isWizard && (user.isWizard || user2.name == "Harry) Question 1 Consider the two following code samples: First Code Block Hay, Alex', 'Claire', Dolores', 'Claire var memo - (); L'Alex', Charlie", "Dolores' *Alex').forEach(function(name) if (memo[name]) { memo[name] - B; meno name) - 1 }); Second Code Block var memo = {}; (Alex', 'Charlie', 'Dolores', May: Alex', 'Claire', 'Dolores', 'Claire', Alex').forEach(function(name) memo[name] - true; }).keys(); How, if at all, will the final value of nemo differ between these two code blocks? Select the best answer. The final value of neno will be the same after both operations. In both code blocks, memo is an object, with the same keys. However, in the first code block, the values stored under those keys will be counts of the number of times each name has appeared in the list. Second Code Block var memo = 0); ('Alex, 'CharlieDolores', May', 'Alex', 'Claire. 'Dolores, Claire 'Alex').forEach(function(name) { memo[name] - true; }). keys(); How, if at all, will the final value of memo differ between these two code blocks? Select the best answer. The final value of memo will be the same after both operations. In both code blocks, nemo is an object, with the same keys. However, in the first code block, the values stored under those keys will be counts of the number of times each name has appeared in the list. In the first code block, memo is an array containing all of the names from the array, only without any duplicates. In the second code block, meno is an empty object. In the first code block, meno is an object containing counts of the number of times each name has appeared. In the second code block, meno is an array containing all of the values of the initial array, only without duplicates

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago