Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

codewars js Shortest Word

function findShort(s) {
    var arr = s.split(' ');
    var smallest = arr[0];
    for (var i = 0; i < arr.length; i++) {
        if (arr[i].length < smallest.length) {
            smallest = arr[i];
        }
    }
    return smallest.length;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: variable name as a string in Javascript function 
Javascript :: what are undeclared and undefined variables in javascript 
Javascript :: javascript array length 
Javascript :: discord.js lock channel 
Javascript :: javascripts events 
Javascript :: Adding an item to an array 
Javascript :: get subdomain from url javascript 
Javascript :: update text react native 
Javascript :: mdn javascript 
Javascript :: cheerio each 
Javascript :: julia function 
Javascript :: remove element from object javascript 
Javascript :: jquery datepicker disable dates dynamically 
Javascript :: how to sort one element in property javascript 
Javascript :: array function in javascript 
Javascript :: TextInput cursor not shown react native 
Javascript :: useeffect loading state 
Javascript :: create immutable object in javascript 
Javascript :: javascript check string sort ascending 
Javascript :: javascript bigdecimal 
Javascript :: JS copy image 
Javascript :: recorrer array javascript 
Javascript :: tablica w javascript 
Javascript :: node js find directory change directory 
Python :: python tkinter window fullscreen 
Python :: pytorch check if using gpu 
Python :: install telethon 
Python :: print bold python 
Python :: time it python 
Python :: sleep 5 seconds py 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =