5 fun JavaScript coding exercises

5 JavaScript coding Exercises 1 Reverse a String:FizzBuzz:Palindrome Checker:Random Number Generator:Capitalize the First Letter of Each Word: Reverse a String: Write a function that takes a string as an argument and returns the string in reverse order. For example, if the input string is “hello”, the output should be “olleh”. function reverseString(str) {   return str.split(“”).reverse().join(“”); … Read more

10 JavaScript Coding Mistakes with solutions

10 JavaScript Coding Mistakes with solutions Not declaring variables properly:Using the wrong comparison operator:Not using semicolons:Not understanding scoping:Using “var” instead of “let” or “const”:Instead, use “let” or “const”:Using “==” instead of “===”:Not using curly braces in if statements:Using “parseFloat” instead of “parseInt”:Not handling asynchronous code properly:Example using a promise:Example using async/await:Not properly scoping variables:Example using … Read more

JavaScript Code Exercises 4

JavaScript Code Exercises 4 Exercise 1: Sum All Numbers in a RangeExercise 2: Diff Two ArraysExercise 3: Seek and DestroyExercise 4: Wherefore art thou Exercise 1: Sum All Numbers in a Range Write a function that takes an array of two numbers as input and returns the sum of all the numbers between them, inclusive. … Read more

JavaScript Code Exercises 3

JavaScript Code Exercises 3 Exercise 1: Title case a sentenceExercise 2: Find the largest number in an arrayExercise 3: Confirm all elements in an array are the sameExercise 4: Count the number of vowels in a string Exercise 1: Title case a sentence Write a function that takes a sentence as input and returns a … Read more

JavaScript Code Exercises 2

JavaScript Code Exercises 2 Exercise 1: Reverse a stringExercise 2: Factorialize a numberExercise 3: Check for palindromeExercise 4: Find the longest wordExercise 5: Title case a sentenceExercise 6: Return largest numbers in arraysExercise 7: Confirm the endingExercise 8: Repeat a stringExercise 9: Truncate a stringExercise 10: Chunky monkey Exercise 1: Reverse a string Write a … Read more

JavaScript Code Exercises 1

JavaScript Code Exercises 1 Write a function that takes an array of numbers and returns the sum of all the positive numbers in the array.Write a function that takes an array of strings and returns the shortest string in the array.Write a function that takes a string and returns a new string with all the … Read more

Common HTML Mistakes 3

Common HTML Mistakes 3 Using outdated code:Ignoring SEO best practices:Overusing div tags:Using too many inline styles:Not using the correct file extensions:Using too many different fonts:Not using proper indentation:Ignoring accessibility requirements:Using invalid HTML:Ignoring cross-browser compatibility: Using outdated code: Solution: Keep up-to-date with HTML standards and avoid using outdated or deprecated code. Ignoring SEO best practices: Solution: … Read more

Common HTML Mistakes 2

Common HTML Mistakes 2 Using non-ASCII characters:Using inline JavaScript:Using duplicate IDs:Not specifying character encoding:Overusing heading tags:Ignoring responsive design:Forgetting to close self-closing tags:Using too many nested elements:Using non-standard HTML:Not optimizing images: Using non-ASCII characters: Solution: Use ASCII characters to ensure maximum compatibility across different devices and browsers. Using inline JavaScript: Solution: Move JavaScript code into a … Read more

Common HTML Mistakes 1

Missing DOCTYPE declaration:Unclosed tags:Improper nesting of tags:Missing alt text for images:Using deprecated tags or attributes:Using inline styles instead of CSS:Incorrectly formatted links:Using non-semantic markup:Using tables for layout:Ignoring accessibility: Missing DOCTYPE declaration: Solution: Add a DOCTYPE declaration to the top of your HTML document to specify the version of HTML you are using. Unclosed tags: Solution: … Read more

Web Design HTML CSS JavaScript Navbar and CSS Grid Box

Web Page Examples CSS HTML To create a CSS grid for four child divs that are arranged in a two-by-two grid within a parent element, you can use the following code: HTML: <div class=”grid-container”>   <div class=”grid-item”>Div 1</div>   <div class=”grid-item”>Div 2</div>   <div class=”grid-item”>Div 3</div>   <div class=”grid-item”>Div 4</div> </div> CSS: .grid-container {   display: grid;   grid-template-columns: repeat(2, 1fr); … Read more