Beginner friendly: Sorting a string and then reversing it to return the highest possible int.

If we had the integer 1105198, we would want to sort it to 0111589, then reverse it in order to make the highest integer possible, which would be 9851110.

  • Define your function with a parameter for the integer
  • Cast the integer into a String data-type and split the string on each character
  • On the string, chain the sort method and the reverse method
  • To change the string back to an integer, use the Number() object. …

A breakdown of how to reverse an array of numbers using a for loop in JavaScript.

For loop diagram

Lets take the array: [11, 5, 19, 98]for example. We want the reverse: [98, 19, 5, 11]

function reverseArrayOfNumbers(arr){

*code body*


This is to store the numbers in once they’ve been reversed

let reverseArray = [];

for (let i = arr.length — 1 ; i >=0 ; i--){

*for loop code body*


Why i = arr.length — 1?

  • i will be our index when iterating through the array
  • [11, 5, 19, 98]has a length of 4 elements inside the array but indexes start from 0, so its index is 0, 1, 2, 3 — we minus 1 from…

Alexa, play “Do It” by Chloe x Halle.

Most people familiar with coding know about Python, either what it is or how it works. Someone who is new and wanting to learn how to code might even consider learning Python as their first language. Here’s my take on that:

Do it.

It’s been roughly 8 months since I learnt to code and become a full-stack developer, and in that space I’ve become proficient in a multitude of things, mainly focussing on JavaScript and my favourite JS library, React.

However — last month, I learnt Python for the first time. I’ve…

Object-oriented programming

A few weeks ago I found out there are developers who have been coding for 3, maybe 4+ years and considered Junior. I’m still on 5, nearly 6 months of learning, but I’m willing to put in the hours and the years, starting with trying to get my head around the 4 core object oriented programming.

At the moment everyone’s favourite question for me seems to be:

‘Do you know what object oriented programming is?’

The first time I was asked, I didn’t know. The second time I was asked, I knew slightly, but that wasn’t good enough for me…

Over the last few months, I’ve built up a stock pile of coding articles that I want to read. Sometimes I scroll past interesting articles on LinkedIn, or Medium sends me great suggestions through newsletters. I always open the articles and say, “I’ll read them soon”.

Well today is the day I finally mean it. I have a whooping 37 (yeah, thirty-seven) open tabs of articles just sitting ready for me. I’m taking a break from coding today and I think reading through these coding articles will be a break well spent. …

Finding a Balance between Comfort and Coding

If we weren’t in the middle of a pandemic this article would probably consist of ‘sit in your local coffee shop! Sip and relax as you code!’ with flower and sparkle emoji’s. You know the ones.

If you’re like me, my only environments to work in are my bedroom, my kitchen, or my living room. At times, neither are ideal or can become a bit stale or repetitive.

90% of my work is done in my room at my desk, my tip to everyone is avoid doing work in or on your bed…

If you’ve got buttons that look uneven, differing heights and a bit messy, like this:

But you want them to all be perfectly aligned, like this:

With the help of a wonderful volunteer from the Black Codher Bootcamp, I set out to create my own super simple loading page that’s hopefully less complex and easier for other coding newbies like myself to understand.

Here’s how:

1) Creating the Loading Page component as set below.

Edits you may want to make here:

  • The ‘4000’ on the setTimeout function: This means my loading page will display for 4 seconds. Feel free to make yours longer or shorter.
  • Everything inside the return statement: My loading page uses a Spinner imported from Bootstrap and a h1 tag. You can inset anything you’d like the loading page to display inside…

Even as I write this, I’m tired and my eyes hurt a little.

I’ve said many time that coding isn’t “easy”, it takes practice, and the practice is my favourite part. On Friday I spent hours flicking through articles and YouTube video’s trying to look for a solution to a problem I was having.

With each closed article, closed tab, closed video, I didn’t feel frustration at still not finding my answer because I was on the edge of learning something new and slowly but surely improving my code. I enjoyed this. …

Default parameters have been a great addition to ES6, and they are fairly easy to understand with this quick walk through.

So, we start off with some simple code as below. Here, we are passing no arguments, no parameters, my entire statement is in the console log.

const myFaveAnime = () => {
console.log("Gintama is my favourite anime");

Olivia Walker

Hi, I’m Olivia and I’m currently learning how to code. It’s challenging and fun. Join me as I blog about the highs and lows.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store