JavaScript Interview #36: How to add new properties to JavaScript arrays?
Answer and explanation: https://learn.coderslang.com/js-test-36-adding-new-properties-to-array-in-javascript/
Answer and explanation: https://learn.coderslang.com/js-test-36-adding-new-properties-to-array-in-javascript/
Coderslang: Become a Software Engineer
JS Interview #36: Can you add a new property to the JS array?
Does the new array property affect its length? Is such an assignment valid at all?
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
How to add a new field to the JS array? What’s the output?
Answer and explanation: https://learn.coderslang.com/js-test-36-adding-new-properties-to-array-in-javascript/
Answer and explanation: https://learn.coderslang.com/js-test-36-adding-new-properties-to-array-in-javascript/
JavaScript, calculate a square root using Math.sqrt()
https://learn.coderslang.com/0031-javascript-calculate-square-root-with-math.sqrt/
https://learn.coderslang.com/0031-javascript-calculate-square-root-with-math.sqrt/
Coderslang: Become a Software Engineer
JavaScript, calculate a square root using Math.sqrt()
To calculate the square root of the number in JavaScript, you can use the function Math.sqrt(). You pass in a number, and it returns the square root of this number.
JavaScript, remove last character from a string
https://learn.coderslang.com/0030-javascript-remove-last-character-from-a-string/
https://learn.coderslang.com/0030-javascript-remove-last-character-from-a-string/
Coderslang: Become a Software Engineer
JavaScript, remove last character from a string
JavaScript strings are immutable. This means that once the string was created it can’t be changed. When you need to remove the last character from a string in JavaScript, you should create a new string without this character.
We just pushed a huge update to js.coderslang.com
The main improvement - website speed. Page load time should increase about 3x. For slow internet connections and outdated computers/phones the improvements will be very clear.
Before updating we’ve tested everything for a couple of days in the dev environment. In case we missed something and you’ll find a bug - ping me for a free cookie 🙂
The main improvement - website speed. Page load time should increase about 3x. For slow internet connections and outdated computers/phones the improvements will be very clear.
Before updating we’ve tested everything for a couple of days in the dev environment. In case we missed something and you’ll find a bug - ping me for a free cookie 🙂
JavaScript Interview Question 38: Sum of JS arrays. What’s the ouput?
Answer and Explanation: https://learn.coderslang.com/js-test-38-adding-3-arrays-of-integers/
Answer and Explanation: https://learn.coderslang.com/js-test-38-adding-3-arrays-of-integers/
JavaScript, using Math.floor to round a number
https://learn.coderslang.com/0033-javascript-using-math.floor-to-round-a-number/
https://learn.coderslang.com/0033-javascript-using-math.floor-to-round-a-number/
Coderslang: Become a Software Engineer
JavaScript, using Math.floor to round a number
In JavaScript there are a couple of ways of rounding a number. The function Math.floor rounds the number down. It accepts a number n and returns the biggest integer that’s less than or equal n.
Algorithm complexity and efficiency
https://learn.coderslang.com/0035-algorithm-complexity-and-efficiency/
https://learn.coderslang.com/0035-algorithm-complexity-and-efficiency/
Coderslang: Become a Software Engineer
Algorithm complexity and efficiency
All algorithms have 2 main characteristics:
Amount of required memory. Execution time. These two are used to compare algorithms with each other. Some algorithms are faster, but require more memory, while others are vice versa.
Amount of required memory. Execution time. These two are used to compare algorithms with each other. Some algorithms are faster, but require more memory, while others are vice versa.
JS Interview #39: How does
Answer and Explanation: https://learn.coderslang.com/js-test-39-delayed-log-inside-the-loop/
setTimeout
work inside the for
loop?Answer and Explanation: https://learn.coderslang.com/js-test-39-delayed-log-inside-the-loop/
Optimized bubble sort in JavaScript. Cocktail sort.
https://learn.coderslang.com/0037-javascript-optimized-bubble-sort.-coctail-sort/
https://learn.coderslang.com/0037-javascript-optimized-bubble-sort.-coctail-sort/
Coderslang: Become a Software Engineer
Optimized bubble sort in JavaScript. Cocktail sort
Bubble sort algorithm doesn’t track the current state of the array.
Even if it gets the fully sorted array as an input, the runtime will remain of the same O(n^2^) complexity.
Even if it gets the fully sorted array as an input, the runtime will remain of the same O(n^2^) complexity.