Tutor profile: Charles T.
Questions
Subject: Web Development
Why are script tags typically placed at the bottom of the body tag? When would it be okay to not have it at the bottom?
Script tags are typically at the bottom of the body so that it does not cause render blocking. This is because when a script tag is read, the rest of the code after it will not be read until the script is finished executing. However, script tags can be anywhere in the body and will not render block if the code in the script tag is asynchronous such as using setTimeout.
Subject: Javascript Programming
Given an array with an unknown amount of numbers, write a function using a for loop to double each number in the array and return the array.
function doubleNumbers(arr) { for(let i = 0; i < arr.length; i++) { arr *= 2; } return arr; }
Subject: HTML5 Programming
What are the names of the four attribute syntax styles allowed in HTML5? Give examples of each.
The four attribute syntax styles allowed in HTML5 are empty, unquoted, single quoted, and double quoted. empty <input type="text" value="John" disabled> Unquoted <input type="text" value=John> Double-quoted <input type="text" value="John Doe"> Single-quoted <input type="text" value='John Doe'>
Contact tutor
needs and Charles will reply soon.