JSFiddle - React, Tailwind, and code Playground

by Ilya

JavaScript

function repeat (count, action) {
	for	(let i = 0; i <= count; i++) {
  	console.log('action', action)
    action(i)
  }
}

function unless(test, than) {
console.log('test', test)
console.log('than', than)
	if(!test) than()
}

repeat(3, t => {
	console.log('t', t)
	unless(t % 2 == 1, y => {
  console.log('y', y)
  	console.log(t + ' четное число')
  })
})