This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>XML-Jquery</title> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Do some stuff when page hmtl page is launched | |
| $(document).ready(function () { | |
| $("#headerTitle").hide(300).show(1500); | |
| // calling show food menu function | |
| showFoodMenu(); | |
| // If you want to fetch data from the file | |
| // call fetch data function instead of showFoodMenu | |
| // fetchData() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // return true if an item exists in list | |
| // and false if it doesn't | |
| var fruits = ["Banana", "Orange", "Apple", "Mango"]; | |
| var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]; | |
| function checkItemInList(item, list) { | |
| return list.includes(item); | |
| } | |
| console.log('Is Mango in Fruit List:', checkItemInList('Mango', fruits)); // true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // get the lenght of an array list | |
| var fruits = ["Banana", "Orange", "Apple", "Mango"]; | |
| var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]; | |
| function getListLenght(list) { | |
| var _lenght = list.length; | |
| return _lenght; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* -- **************************************************************************************** | |
| -- Device = Laptops, Desktops * | |
| -- Screen = B/w 1025px to 1280px * | |
| ** -- ***************************************************************************************/ | |
| @media (min-width: 1025px) and (max-width: 1280px) { | |
| /* CSS style here */ | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Box Shadow</title> | |
| <style> | |
| .box { | |
| height: 150px; | |
| width: 300px; | |
| margin: 20px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // read an array of array | |
| function readArrayOfArray() { | |
| // This is an array of arrays. | |
| // It is a little easier to read like this: | |
| var arrayNumberFruit = [ | |
| [1, 'Orange'], | |
| [2, 'Banana'], | |
| [3, 'Apple'], | |
| [4, 'Mango'] | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // recursive calculation of Fibonacci numbers | |
| function fibonacci(number) { | |
| if (number <= 1) return number; | |
| return fibonacci(number - 2) + fibonacci(number - 1); | |
| } | |
| console.log(fibonacci(5)); | |
| console.log(fibonacci(6)); | |
| console.log(fibonacci(7)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Binary Search(Iterative Approach) | |
| var binarySearch = function (array, number) { | |
| var start = 0; | |
| var end = array.length - 1; | |
| // Iterate while start not meets end | |
| while (start <= end) { | |
| // Find the mid index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "Name": "Paul Pogba", | |
| "club": "Machester United", | |
| "image": "assets/pogba.jpg" | |
| }, | |
| { | |
| "Name": "Luka Modrić", | |
| "club": "Real Madrid", | |
| "image": "assets/modric.jpg" |