To add a block of code to the article, click Code block in the formatting panel of the article:
Insert your code in the gray area that appears.
With the Article Prettify enabled, different elements of the code will be highlighted. This was done to help read the code faster and easier.
Here's what HTML and JS code is going to look like:
HTML code
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>HTML</title>
</head>
<body>
<p class="test-me">
<a href="google.com" title="link">Link</a>
</p>
</body>
</html>
JS code
let bubbleSort = (inputArr) => {
let len = inputArr.length;
for (let i = 0; i < len; i++) {
for (let j = 0; j < len; j++) {
if (inputArr[j] > inputArr[j + 1]) {
let tmp = inputArr[j];
inputArr[j] = inputArr[j + 1];
inputArr[j + 1] = tmp;
}
}
} return inputArr;
};
Comments
0 comments
Please sign in to leave a comment.