Search
 
SCRIPT & CODE EXAMPLE
 

CSS

Add border to the array

let picture =  ["abc", "ded"]; 

function addBorder(picture) {
 //adding the * on the top of the picture array as equal to the lenght of the top element of the array.
 let top = '*'.repeat(picture[0].length);
 picture.unshift(top);

 //looping through the array and concat the * at the end and the start of the array
 for(let i = 0; i < picture.length; i++){
     picture[i] = picture[i] + '*';
     picture[i] = '*' + picture[i];
 }

 //adding the * on the bottom of the picture array as equal to the lenght of the last element of the array.
 let bottom = '*'.repeat(picture[1].length);
 picture.push(bottom);
 
 return picture;
}

Comment

PREVIOUS NEXT
Code Example
Css :: how do I make secret keys available in gatsby-config from Netlify 
Css :: Pass argument to group_by 
Css :: order 
Css :: css 2 images side by side to stack 
Css :: au fourneua bakery 
Css :: css validation 
Css :: if css 
Css :: formatage date css 
Css :: get api url for javascript 
Css :: Drupal 8 Notice: Trying to get property 
Css :: how long since 1993 
Css :: separate three content in web 
Css :: style50 for cs50 
Css :: css transition only once 
Css :: verified icon css 
Css :: access is denied nul server.js 
Css :: How to extend selector 
Css :: IE support stackover flow css 
Css :: p{ color: blue; font-size: 14px; } 
Css :: how to highlight text in css 
Css :: scss transition mixin 
Css :: the user specified as a definer does not exist 
Typescript :: mongodb exists and not null 
Typescript :: typescript record optional 
Typescript :: get minutes between two dates ts 
Typescript :: How to redirect to the previous/next page in Angular 
Typescript :: challenges in agile 
Typescript :: sonar ignore rule 
Typescript :: ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. 
Typescript :: Whats the biggest lesson to know if programming 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =