Question: I am new learner of Javascript and I got stuck in "**functions returned from other functions**". 
The code is as below.

```
var createScream = function(logger) { return function(message) {
            logger(message.toUpperCase() + "!!!")
        }
}

const scream = createScream(message => console.log(message))

scream('functions can be returned from other functions')
scream('createScream returns a function')
scream('scream invokes that returned function')

```

**Console output:**

> 
> "FUNCTIONS CAN BE RETURNED FROM OTHER FUNCTIONS!!!" "CREATESCREAM
>  RETURNS A FUNCTION!!!" "SCREAM INVOKES THAT RETURNED FUNCTION!!!"
> 
> 
> 

**Question:** why it will work this way? what is the process of executing? 
Does function scream have any parameter? how does it work?

This may be very easy, I searched but no clear explanation.
Can someone please give me a hint or explain the whole execution process in details?

Thanks in advance!

Answer: 
I would just make them background images. That way you don't have to worry about overflow. Here I'm setting the anchor to 100% width and height (of its container, so 50% of the page each), which appears to be what you wanted. The `background-position` keeps the left and right images anchored at the top right and top left respectively, and the `background-size` of cover ensures the aspect ratio is kept intact. Note that if your images are taller than they are wide, this might not have the effect intended.

```css
body {
  margin: 0;
}

.page {
  width: 100%;
  height: 100vh;
  font-size: 0;
  display: flex;
  flex-flow: row nowrap;
  justify-content: stretch;
}

.img-wrapper {
   flex: 1 1 50%;
}

.img-wrapper a {
  display: block;
  width: 100%;
  height: 100vh;
  background-repeat: no-repeat;
}

.img-wrapper:first-child a {
  background-image: url(https://picsum.photos/300/200);
  background-position: top 0 left 100%;
  background-size: cover;
}

.img-wrapper:last-child a {
  background-image: url(https://picsum.photos/300/200);
  background-position: top 0 right 100%;
  background-size: cover;
}
```

```html
<body>
  <div class="page">
    <div class="img-wrapper">
      <a href="pol.html"></a>
    </div>
    <div class="img-wrapper">
      <a href="biz.html"></a>
    </div>

  </div>

</body>
```
Use `flex` and give its child elements 50% width. Remove the default margin on body. And to remove white space due to images add `font-size:0` on the `.page` div. You can obviously ovverride this font-size later when you have text on this page for that section.

```css
body {
  margin: 0;
}

.page {
  width: 100%;
  height: 100vh;
  font-size: 0;
  display: flex;
}

.img-wrapper {
  width: 50%;
}

img {
  width: 100%;
  height: 100%;
}
```

```html
<body>
  <div class="page">
    <div class="img-wrapper">
      <a href="pol.html"><img src="https://picsum.photos/300/200"></a>
    </div>
    <div class="img-wrapper">
      <a href="biz.html"><img src="https://picsum.photos/300/200"></a>
    </div>

  </div>

</body>
```