Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Traingle assignment
  • Loading branch information
met18001 committed Feb 12, 2020
1 parent c2eddb7 commit 2ae7292
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
16 changes: 6 additions & 10 deletions week-3/spongebob/js/main.js
Expand Up @@ -5,6 +5,7 @@ let editable = document.querySelector("[contenteditable=true]");

/**
* When focus is removed, run the `formatText` function
* the blur event is when cursor goes off selected text
*/
editable.addEventListener('blur', formatText);

Expand All @@ -18,10 +19,12 @@ function formatText(event){

let characters = this.innerText.split("");
// defining characters as string
//("") splitting between characters

let letters =[];
//creating an array

//characters is now an array
characters.forEach((character, index) => {

if (index % 2 ==1){
Expand All @@ -31,16 +34,9 @@ function formatText(event){
}
});






//let nums=[0,1,2,3,4,5]
//nums.forEach(function(num, index){
//console.log(index % 2 );


//let nums=[0,1,2,3,4,5]
//nums.forEach(function(num, index){
//console.log(index % 2 );

// Replace the old text with new text
this.innerText = letters.join("");
Expand Down
21 changes: 21 additions & 0 deletions week-4/triangle.html
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>

</body>
<script>

var result = "#";

while (result.length <= 7){
console.log(result);
result = result + "#";
}

</script>
</html>

0 comments on commit 2ae7292

Please sign in to comment.