DDimitrisindimitrios.hashnode.dev·Aug 7, 2022 · 1 min readHow to check if a value exists in an array?An easy way to check if a value exists in an array, is to use the method indexOf(). The method indexOf() is applied to an array and takes as argument a value and it searches and returns the first index of the position, where the value is in the array...00
DDimitrisindimitrios.hashnode.dev·Aug 7, 2022 · 2 min readHow to find the Maximum of an array of numbers?If an array of numbers is given how we can find its maximum element? We will answer this question in this article, firstly by examine a simple example and then by creating a function that accepts an array of numbers as input and outputs the maximum ...00
DDimitrisindimitrios.hashnode.dev·Aug 7, 2022 · 3 min readHow to Swap VariablesIn this article we will present 3 ways to swap values in two variables, using JavaScript. The first two can be applied in any programming language, the third is JavaScript specific. The task: We have two variables a, b holding a value each. We want ...00