# Faci

# Program 1

```js
const data = {
  "abba": {
    "namn": "ABBA",
    "id": "A",
    "title": "Produkt från Abba.",
    "documentation": {
      "hello": "hej",
      "id": "B",
    },
  },
  "baab": "id",
};
```

# Program 2

```js
"use strict";

function tri(x) {
  return x + " " + x + " " + x;
}

console.log(tri(tri("hej")));
```

# Program 3

```js
const A = {
   a: 1,
   b:2,
   c:3,
   d:4
}

function Boo {
      return this.a+this.b+this.c;
}
```

# Program 4

```js
let point = 0;

function countCallback() {
  point = point + 2;
  document.getElementById("titel").innerHTML = point;
  window.setTimeout(countCallback, 200);
}
```

# Program 5

```js
      "strict mode";
            let points = 0;
            let total = 5;

            for(let i =0 i < total; i++) {
      	      const tal1 = Math.floor(Math.random()*10)
      	      const tal2 = Math.floor(Math.random()*10)
      	      const question = tal1+"+"+tal2+"=";
      	      const answer = tal1+tal2;
                const tal = Number(prompt(question));

                if(tal = answer) {
      		      console.log("Right");
      		      points++;
      		      document.getElementById('result').innerHTML += "<li>✅ " + question + answer + "</li>";
      		      document.getElementById('points').innerHTML = "Poäng: "+points+"/"+(i+1);
      	      }
      	      else {
      		      console.log("Wrong");
      		      document.getElementById('result').innerHTML += "<li>❌  " + question + answer + " <i> > "+tal+"</i></li>";
      		      document.getElementById('points').innerHTML = "Poäng: "+points+"/"+(i+1);
      	      }
           }
           if(points/total === 1) {
      	      document.getElementById('reaction').innerHTML = "🤩";
           }
           else if(points/total > 0.8) {
      	     document.getElementById('reaction').innerHTML = "😁";
           }
           else {
      	     document.getElementById('reaction').innerHTML = "😭";
           }
```
