Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 2 Question 20 4 pts JS File Naming Convention 2 - Multiple Answer. A JavaScript file named validate.js has the following contents: function validatebate

1
image text in transcribed
2
image text in transcribed
Question 20 4 pts JS File Naming Convention 2 - Multiple Answer. A JavaScript file named "validate.js" has the following contents: function validatebate () { console.log('validatedate just rant); }; var validateInteger = function () { console.log('validateInteger just ran'); 33 Select all the responses that are true. This JavaScript file does not follow the US Naming Convention (outlined in our lecture material) because the file is supposed to only contain a single function or object named the same as the file. Code like this is problematic leven though it will run without error and even though things are named reasonbly well) because when you see a reference to one of these functions (validate Date or validatelngeter), you'll have to guess which us file the function is in Code like this is not well designed because it declares more global functions than it needs to. It is important not to "pollute the global namespace", especially when working on large projects in a programming team JS File Naming Convention - Multiple Answer. A JavaScript file named "validationUtils.js" has the following contents: - var validationutils - 0); validationutils.validatedate = function () { console.log("validatedate just ran'); }; validationutils.validateInteger = function () { console.log('validateInteger just ran'); Select all the responses that are true. This JavaScript file does not follow the JS Naming Convention (outlined in our lecture material) because you are not supposed to put more than one function in an external JS hle. This JavaScript file follows the JS Naming Convention outlined in our lecture material Suppose an HTML page had a reference to this external JS file. JS code in the HTML page would not be able to reference the functions defined in the US hle leg. validationUtils.validateDate) because they would be out of scope a The JS Naming Convention (outlined in our lecture material) is designed to help you (and others) locate functions that have been defined in external JS files. The US Naming Convention (outlined in our lecture material) is designed to minimize the number of globally defined functions and objects which is important, especially when multiple programmers are contributing to a large web application

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

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago