Passed test 1
This commit is contained in:
		
							parent
							
								
									0f2c4f68b2
								
							
						
					
					
						commit
						2a41f84c1a
					
				| 
						 | 
				
			
			@ -1,5 +1,18 @@
 | 
			
		|||
const repeatString = function() {
 | 
			
		||||
const repeatString = function(string, number) {
 | 
			
		||||
 | 
			
		||||
    let result = '';
 | 
			
		||||
 | 
			
		||||
    for (let i = 0; i < number; i++) {
 | 
			
		||||
        if (number < 0) {
 | 
			
		||||
            return 'ERROR';
 | 
			
		||||
        } else {
 | 
			
		||||
            result += string;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return result;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = repeatString
 | 
			
		||||
module.exports = repeatString
 | 
			
		||||
		Loading…
	
		Reference in New Issue