Данный отчёт сгенерирован 10.02.2023 18:21:31 UTC.
HTML версия (этот сайт) сгенерирован 10.02.2023 18:21:38 UTC.
Коммит: [bfeb65b9] add automatic zip creation
10.02.2023 18:21:31
Задача: Типове Тестування 10.02.2023 18:21:31
Описание: Визначити функцію test, яка отримає один аргумент. Якщо аргумент масив, повернути слово 'array', якщо функція, повернути слово 'function', якщо об'єкт, повернути слово 'object', в інших випадках повернути слово 'other'. 10.02.2023 18:21:31
Решений: 86 10.02.2023 18:21:31
Типове Тестування 10.02.2023 18:21:31
 function test(x)
{
    if( Array.isArray(x)){
        return 'array';
    }
    if( typeof x == "function" || typeof x == "object"){
        return typeof x;
    }
    return "other";
}
 function test(x) {
    const type = typeof x;
    if (type === 'function') return 'function';
    if (Array.isArray(x)) return 'array';
    if (type === 'object') return 'object';
    return 'other';
}
 function test(x) {
    const type = typeof x;
    if (type === 'function') return 'function';
    if (Array.isArray(x)) return 'array';
    if (type === 'object') return 'object';
    return 'other';
}
 function test(x){
    if(Array.isArray(x)){
        return "array"
    }
    else if(typeof(x)=='function'){
        return 'function'
    }
    else if(typeof(x)=='object'){
        return 'object'
    }
    else{
        return 'other'
    }
}
 function test(x){
    if(typeof x == 'function'){
        return 'function'
    }
    if(Array.isArray(x)){
        return 'array'
    }
    if(typeof x == 'object'){
        return 'object'
    }

    return 'other'
}
 function test(x){
    if (Array.isArray(x)) return 'array'
    if (typeof x == 'function' || typeof x == 'object') return typeof x
    return 'other'
}
 function test(arg) {
  if (Array.isArray(arg)) {
    return "array";
  } else if (typeof arg === "function") {
    return "function";
  } else if (typeof arg === "object") {
    return "object";
  } else {
    return "other";
  }
}
 function test(arg) {
  if (Array.isArray(arg)) {
    return "array";
  } else if (typeof arg === "function") {
    return "function";
  } else if (typeof arg === "object" && arg !== null) {
    return "object";
  } else {
    return "other";
  }
}
 function test(arg) {
  if (Array.isArray(arg)) {
    return "array";
  } else if (typeof arg === "function") {
    return "function";
  } else if (typeof arg === "object" && arg !== null) {
    return "object";
  } else {
    return "other";
  }
}
 function test(x){
    if (Array.isArray(x)){return "array";}
    else if (typeof x == "function"){return "function";} 
    else if (typeof x == "object"){return "object"}
    else{return "other";}
}
 function test(x)
{
    if(Array.isArray(x) === true)
    {
        return 'array'
    }
    
    if(typeof x === "function")
    {
        return 'function'
    }
    
    if(typeof x === "object")
    {
        return 'object'
    }
    
    else
    {
        return 'other'
    }
}
 function test(x)
{  if(Array.isArray(x)==true){return 'array'}
   if(typeof(x)=='function'){return 'function'}
   if(typeof(x)=='object'){return 'object'}else{return 'other'}
   
}
function test(x) {
    if(typeof(x) == "function") {
        return "function";
    } else if(typeof(x) == "object") {
        if(Array.isArray(x)) // Або можна використовувати x.join == [].join
            return "array";
        return "object";
    }
    return "other";
}
 function test(x){
    if(x.constructor === Array) return 'array';
    if(typeof x === 'function' || typeof x === 'object') return typeof x;
    return 'other';
}
 function test(a){
    if(typeof(a)=='function'){return 'function';}
    else if(Array.isArray(a)){return 'array';}
    else if(typeof(a)=='object'){return 'object';}
    else{return 'other'}
}
 function test(x) {
        if (Array.isArray(x)) { return 'array' }
        else if (typeof (x) == "object") { return 'object' }
        else if (typeof (x) == "function") { return 'function' }
        else { return 'other' }
    }
 function test(x)
{
    if(Array.isArray(x)) return "array";
    else if(typeof x == "object") return "object";
    else if(typeof x == "function") return "function";
    
    return "other";
}
 function test(x){
    const a = typeof x;
    if (a === 'function') {
        return 'function';
    }
    if (Array.isArray(x)) {
        return 'array';
    }
    if (a === 'object') {
        return 'object'
    }
    return 'other';
}
 function test(x){
    if(Array.isArray(x)) return 'array'
    if(typeof x == 'function') return 'function'
    if(typeof x == 'object') return 'object'
    return 'other'
}
 function test(x){
    if(Array.isArray(x)){
        return 'array'
    }else if(typeof(x) == 'function'){
        return 'function'
    }else if(typeof(x) == 'object'){
        return 'object'
    }else{
        return 'other'
    }
}
 function test(x)
{
    if(typeof(x)=="object"){
        if(Array.isArray(x)){
            return "array";
        }
        return "object";
    }
    if(typeof(x) == "function"){
        return "function";
    }
    return "other";
}
 function test(x) {
    if (Array.isArray(x)) {
        return "array";
    }
    else if (typeof x == "function") {
        return "function";
    }
    else if (typeof x == "object") {
        return "object";
    }
    else {
        return "other";
    }
}
 function test(x) {
    const type = typeof x;
    if (type === 'function') return 'function';
    if (Array.isArray(x)) return 'array';
    if (type === 'object') return 'object';
    return 'other';
}
 function test(x)
{
        res =Object.prototype.toString.call(x);
        if(res == "[object Array]")
            return 'array';
        if(res == "[object Object]")
            return 'object';
        if(res == "[object Function]")
            return 'function';
        return 'other'        
}
 function test(x){
    if(typeof x === 'function'){
        return 'function';
    }else if(Array.isArray(x)){
        return 'array';
    }
    else if(typeof x === 'object'){
        return 'object';
    }else {
        return 'other';
    }
}
 function test(x) {
    const type = typeof x;
    if (type === 'function') return 'function';
    if (Array.isArray(x)) return 'array';
    if (type === 'object') return 'object';
    return 'other';
}
 function test(x){
    let str = typeof x;
    let str2=""
    if(str=="function"){
        return "function"
    }
    if(str=="object"){
        if (Array.isArray(x)==true){return "array"}
        else{return "object"}}
    else{return "other"}
}
 function test(x) {
    if (Array.isArray(x) == true) return 'array';
    if (typeof x == 'function') return 'function';
    if (typeof x == 'object') return 'object';
    else return 'other';
}
 function test(x)
{
    if(Array.isArray(x) == true)
    {
        return 'array'
    }
    if(typeof(x) == 'function')
    {
        return 'function'
    }
    if(typeof(x) == 'object')
    {
        return 'object'
    }
    else
    {
        return 'other'
    }
}
 function test(x){
    if(Array.isArray(x) == true){
        return 'array';
    }
    else if(typeof x == 'object' || typeof x == 'function'){
        return typeof x;
    }
    else{
        return 'other';
    }
}
 function test(x) {
        if (Array.isArray(x) == true) return 'array'
        if (typeof (x) == 'function') return 'function'
        if (typeof (x) == 'object') return 'object'
        else return 'other'
        //return Array.isArray(x)
    }
 function test(x) {
    if(Array.isArray(x) === true)
    return 'array';
    if(typeof x === 'function')
    return 'function';
    if(typeof x === 'object')
    return 'object';
    else 
    return 'other';
}
 function test(x) {
    if (Array.isArray(x)) {
        return 'array';
    }
    if (typeof(x) == 'function') {
        return 'function';
    }
    if (typeof(x) == 'object') {
        return 'object';
    }
    return 'other';
}
 function test(x){
    if (Array.isArray(x)){
        return 'array';
    }
    else if (((typeof x) == 'object')||((typeof x) == 'function')){
        return typeof x;
    }
    else{
        return 'other';
    }
}
 function test(x) {
    if (typeof(x) == 'function') return 'function';
    if (Array.isArray(x)) return 'array';
    if (typeof(x) == 'object') return 'object';
    
    return 'other';
}
 function test(x){
    let splittedX = `${x}`.split('')
    if (splittedX[0] == 'f') return 'function'
    if(typeof(x)!= 'object') return 'other'
    try{
        x.push(123)
        return 'array'
    }
    catch{
        return 'object'
    }
}
 function test(x){
        let box = {}.toString.call(x).slice(8, -1).toLowerCase()
    if(box == "array" || box == "function" || box == 'object'){
        return box;
    }
    return "other";
}
 function test(x){
  if (arguments.length > 1 || typeof x == 'string' || typeof x == 'boolean' || typeof x == 'number'){
    return 'other'
  } 
  if (typeof x == 'object'){
    if (Array.isArray(x)==true){
      return 'array'
    }
    return 'object'
  }
  if (typeof x == 'function'){
    return 'function'
  }
}
 function test(x) {
    const type = typeof x;
    if (type === 'function') return 'function';
    if (Array.isArray(x)) return 'array';
    if (type === 'object') return 'object';
    return 'other';
}
 function test(x){
    if (Array.isArray(x)){return "array";}
    else if (typeof x == "function"){return "function";}
    else if (typeof x == "object"){return "object"}
    else{return "other"}
}
 const checkArr = x => Array.isArray(x);
const checkFunction = x => typeof (x) == "function" ? true : false;
const checkObj = x => typeof (x) == "object" ? true : false;
function test (x) {
if (checkArr(x))
return 'array';
if (checkFunction(x))
return 'function';
if (checkObj(x))
return 'object';
return 'other';
}
 function test(x){
    if (Array.isArray(x)==true)
    return 'array';
   if (typeof x === 'object')
   return 'object';
   if (typeof x === 'function')
   return 'function';
   else 
   return 'other';
}
 function test(x){
    if(Array.isArray(x)) return 'array'
    if(typeof x == 'function' || typeof x == 'object') return typeof x
    return 'other'
}
 function test(x){
  if(Array.isArray(x))return "array";
  if(typeof x == "function" || typeof x == "object") return typeof x;
  return 'other';
}
console.log(test([]))
 function test(x) {
  if (typeof x === "function") {
  return ("function");
}  if (Array.isArray(x)) { 
  return ("array");
} if (typeof x === "object") {
  return ("object"); 
 } else {return ("other")}
}
 function test(x){
    if(Array.isArray(x) === true){
        return 'array'
    }
    if(typeof x === 'function'){
        return 'function';
    } else if(typeof x === 'object'){
        return 'object';
    } else{
        return 'other';
    }

}
 function test(x){
    if(Array.isArray(x) == 1){
        return 'array';
    }
    else if(typeof x == "function"){
        return "function";
        
    }
    else if(typeof x == "object"){
        return "object";
        
    }
    else{
        return "other";
    }
}
 function test(x)
{
    if (true == Array.isArray(x)){
        return "array";
    }
    else if(typeof(x)=='function') 
    {
        return "function";
    }
    else if(typeof(x)=='object'){
        return 'object'}
    else{
    return 'other'}
}
 function test(x){
    if (Array.isArray(x)== true){
        return 'array'
    }
    if (typeof x == 'function'){
        return 'function';
    }
    if (toString.call(x) == '[object Object]' ){
        return 'object'
    }
    else{
        return 'other'
    }

}
 function test(x) {
    if (Array.isArray(x)) return "array";
    if (typeof x === "function") return "function";
    if (typeof x === "object") return "object";
    return "other";
}
 function test(x){
    if (Array.isArray(x)) return ("array");
    else if (typeof(x) == "function" || typeof(x) == "object") return (typeof(x));
    else return ("other");
}
 function test(arg) { return Array.isArray(arg) ? 'array' : typeof arg === 'function' ? 'function' : typeof arg === 'object' ? 'object' : 'other'; }
 function test(x){
    if(x instanceof Array) {
        return "array";
    }else if(x instanceof Function) {
        return "function";
    }else if(x instanceof Object) {
        return "object";
    }else {
        return "other";
    }
}
 function test(x){
    if (Array.isArray(x)){
        return 'array'
    }
    if(typeof(x) == typeof({x:'x'})){
        return 'object'
    }
    if(typeof(x) == 'function'){
        return 'function'
    }
    else return 'other'
    
     
}
 function test(x)
{
   if (Array.isArray(x)) return 'array';
   else if (typeof x === 'function') return 'function';
   else if (typeof x === 'object') return 'object';
   else return 'other'
}
 function test(x){
    if(Array.isArray(x) == true) return('array');
    else if(typeof x === 'function') return('function');
    else if(typeof x === 'object') return('object');
    else return('other');
}
 function test(x)
{
    let forArray = x => Array.isArray(x);
    let forFunction = x => typeof x == 'function' ? true : false;
    let forObj = x => typeof x == 'object' ? true : false;

    if(forArray(x))
        return 'array';

    else if(forFunction(x))
        return 'function';

    else if(forObj(x))
        return 'object';

    else
        return 'other';
}
 function test(x)
{
    if(Array.isArray(x) == true)
    {
        return "array";
    }
    if(typeof(x) == "object" || typeof(x) == "function")
    {
        return typeof(x);
    }
    return "other";
}
 function test(x)
{
if(Array.isArray(x)==true) 
return "array"
if(typeof(x) == "object" || typeof(x) == "function") 
 return typeof(x)
return "other"
}
 function test(x){
    if (x instanceof Array) return 'array';
    else if (x instanceof Function) return 'function';
    else if (x instanceof Object) return 'object';
    else return 'other';
}
 function test(x) {
    const type = typeof x;
    if (type === 'function') return 'function';
    if (Array.isArray(x)) return 'array';
    if (type === 'object') return 'object';
    return 'other';
}
 function test (x) {
    if (Array.isArray(x)) return 'array'
    if (typeof x === 'object') return 'object'
    if (typeof x === 'function') return 'function'
    else return'other'
}
 function test(x){
    if (Array.isArray(x)){
        return 'array';
    }
    else if (((typeof x) == 'object')||((typeof x) == 'function')){
        return typeof x;
    }
    else{
        return 'other';
    }
}
 function test(x){
  let type = typeof(x);
  if(type == 'function'){
      return 'function';
  }
  if(type == "object"){
    if(Array.isArray(x) == true){
      return 'array';
    }
    else{
      return 'object';
    }
  }
  return 'other';
}
 function test(x){
    if(Array.isArray(x)) return 'array';
    if(typeof(x) == 'function') return 'function';
    if (typeof(x) == 'object') return 'object';
    
    return 'other';
}
 function test(x) {
        if (Array.isArray(x) == true) return 'array'
        if (typeof (x) == 'function') return 'function'
        if (typeof (x) == 'object') return 'object'
        else return 'other'
        //return Array.isArray(x)
    }
 function test(x){
    if(Array.isArray(x)==true){
        return "array"
    }
    else if(typeof x == "function"){
        return "function"
    }
    else if(typeof x == "object"){
        return "object"
    }
    return "other"
}
 function test(x) {
    if (typeof x == 'object') {
        if (x == null) return 'other';
        else if (Array.isArray(x)) return 'array';
        else return 'object'
    }
    else  if (typeof x == 'function') return 'function';
    else return 'other';
}
 function test(x) {
        if (Array.isArray(x) == true) return 'array'
        if (typeof (x) == 'function') return 'function'
        if (typeof (x) == 'object') return 'object'
        else return 'other'
        //return Array.isArray(x)
    }
 function test(x){
    if (Array.isArray(x)){
        return 'array'
    }
    if(typeof(x) == typeof({x:'x'})){
        return 'object'
    }
    if(typeof(x) == 'function'){
        return 'function'
    }
    else return 'other'
    
     
}
 function test(x){
  if (Array.isArray(x) == true) return "array";
  if (typeof x == 'function') return "function";
  if (typeof x == 'object' && Array.isArray(x) !== true) return "object";
  else return "other";
}
 function test(x)
{
    let splittedX = `${x}`.split('')
    if (splittedX[0] == "f") return "function"
    if (typeof(x) != "object") return "other"
    try {
        x.push(641)
        return 'array'
    }
    catch{
        return "object"
    }
}
 function test(x) {
    if (Array.isArray(x)) {
        return "array";
    }
    else if (typeof x == "function") {
        return "function";
    }
    else if (typeof x == "object") {
        return "object";
    }
    else {
        return "other";
    }
}
 const test = x => Array.isArray(x) ? 'array' : ['function', 'object'].includes(typeof x) ? typeof x : 'other';
 function test(x){
    if(typeof x === 'function') return 'function';
    if(Array.isArray(x))        return 'array';
    if(typeof x === 'object')   return 'object';
    return 'other';
}
 function test(x)
{
    if(Array.isArray(x)==true) return 'array';
    
    if(typeof x =='object') return 'object';
    if(typeof x =='function') return 'function';
    return 'other';
}
 function test(x) {
    if (Array.isArray(x)) return "array";
    if (typeof x === 'function' || typeof x === 'object') return typeof x;
    return "other";
}
 function test(x) {
    if(typeof x == 'object') {
        if(x.length >= 0)
            return 'array';
        return 'object';
    }
    if(typeof x == 'function')
        return 'function';
    return 'other';
}
 function test(x) {
    let toString = {}.toString;
    if (toString.call(x) === '[object Array]')
        return 'array';
    if (toString.call(x) === '[object Object]')
        return 'object';
    if (toString.call(x) === '[object Function]')
        return 'function';
    else
        return 'other'
}
 function test(x) {
    if (x instanceof Array) return "array"
    switch (typeof x) {
        case "function": {return 'function'}
        case "object": {return 'object'}
        default: {return 'other'}
    }
}
 function test(x){
    if (x.constructor.name === 'Array'){
        return ('array')
    }
    else if (typeof x === "function"){
        return ('function')
    }
    else if (typeof x === "object"){
        return ('object')
    }
    else{
        return ('other')
    }
}
 function test(x){
    if(typeof x == 'function'){
        return 'function';
    }else if(Array.isArray(x)){
        return 'array';
    }else if(typeof x == 'object'){
        return 'object';
    }else{
        return 'other';
    }
}
 function test(x)
{
    return Array.isArray(x)?'array': typeof(x)==='function'?'function':typeof(x)==='object'?'object':'other';
}
 function test(x){
    if (typeof(x) != "number" &&typeof(x) !="string"&&typeof(x) !="boolean"&&typeof(x) !="undefined"){
       if (typeof(x[1]) != "undefined"   ){
        return "array"
        
       }
    return typeof(x)
    }
    else return "other"
}
 function test(x){
     if (Array.isArray(x)){ return 'array'}
    else if (typeof x == 'function') {return 'function'}
    else if (typeof x == 'object') {return 'object'}
    else {
        return 'other'
    }
}
 function test(x){
    if(Array.isArray(x))return"array";
    if(typeof x === 'function'|| typeof x === 'object') return typeof x;
    return 'other';
}