Tasks

замыкание

function closure() {
  let count = 0;
  
  return function coun1t() {
    return count++;
  }
}

let count1 = closure();
console.log(count1());
console.log(count1());
console.log(count1());

debounce

bubble sort

reduce

random min man

Redux

createStore(redux)

Or

insertAfter

querystring /queryparams

Sum function with different number of params

sum(1, 2, 3) => 6

sum(3, 4) => 7

Array

Deep of Array

Currying

To make a function multiplyAll which takes an array of integers as an argument. This function must return another function, which takes a single integer as an argument and returns a new array.

  • The returned array should consist of each of the elements from the first array multiplied by the integer.

  • multiplyAll([1, 2, 3])(2) ======> [2, 4, 6];

Каррирование sum(a,b) разное кол-во параметров

Sport

Remove duplicates from the list

Or

Return an array containing the numbers from 1 to N, where N is the parametered value. N will never be less than 1.

  • If the value is a multiple of 3: use the value 'Fizz' instead

  • If the value is a multiple of 5: use the value 'Buzz' instead

  • If the value is a multiple of 3 & 5: use the value 'FizzBuzz' instead

Given a string of words, return the length of the shortest word(s).

Square every digit of a number and concatenate them.

  • For example, if we run 9119 through the function, 811181 will come out, because 92 is 81 and 12 is 1.

  • Note: The function accepts an integer and returns an integer

Find The Duplicated Number in a Consecutive Unsorted List

Objects

Get output:

Solution:

Count all the occurring characters in a string. If you have a string like aba, then the result should be {'a': 2, 'b': 1}.

Дан объект {name: 'Петр', 'surname': 'Петров', 'age': '20 лет', }. Запишите соответствующие значения в переменные name, surname и age. Сделайте так, чтобы, если какое-то значение не задано - оно принимало следующее значение по умолчанию: {name: 'Аноном', 'surname': 'Анонимович', 'age': '? лет'}.

detectCollision function

The detectCollision function searches through an array of rectangles and returns the first rectangle that the given point is inside of.

Use destructuring and a higher-order function to make this code cleaner. You might want to use the new array method find, which takes a function as argument, and returns the first element in the array (the element, not its index) for which the function returns true.

String

Palindrome

A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. This includes capital letters, punctuation, and word dividers.

Anagram Detection

An anagram is the result of rearranging the letters of a word to produce a new word (see wikipediaarrow-up-right).

Note: anagrams are case insensitive

Complete the function to return true if the two arguments given are anagrams of each other; return false otherwise.

or

Reverse

Number

Is a number prime?

Century From Year

Node Js

/file?rout=text.txt

Как отправить файл, который находится в пути роута?

TS

To create functions

Таска надо определить что в строке все скобки стоят валидно и попарно

fn("(|)") - return true

fn ("{(})") - return false

-------------------------------------------------------------------------------------------------------------------------------------------------------------

Посчитать кол-во цифр в числе

-------------------------------------------------------------------------------------------------------------------------------------------------------------

Перемножить массив чисел (кол-во может отличаться)

-------------------------------------------------------------------------------------------------------------------------------------------------------------

Строка со словами. Вывести массив со словами с большой буквы + строку с первыми буквами этих слов

----------------------------------------------------------------------------------------------------------------------------------------------------------------

Last updated