{
    "path": "/home/krm/dev/mimer-academia/programing/js/datatypes/Sections/boolean.sv.json",
    "s": "Ignor",
    "invert": true,
    "level": 1,
    "title": [
        "Boolean i JavaScript"
    ],
    "author": [
        "krm"
    ],
    "created": {
        "year": 2018,
        "month": 10,
        "day": 21
    },
    "status": "alpha",
    "description": [],
    "statments": [],
    "comment": [],
    "cards": [
        {
            "level": 1,
            "title": [
                "# 👁️‍🗨️  Om boolena i  js"
            ],
            "description": [
                "Boolean används oftast indirekt."
            ],
            "statments": [
                {
                    "description": [
                        "Boolean har alltid funnits i JS."
                    ]
                }
            ],
            "comment": []
        },
        {
            "level": 1,
            "title": [
                "❓ Vad är Boolean?"
            ],
            "description": [
                "Boolean är en typ av värde som antingen är sant eller flakst."
            ],
            "statments": [
                {
                    "description": [
                        "true är sant."
                    ]
                },
                {
                    "description": [
                        "false är falskt."
                    ]
                },
                {
                    "description": [
                        "Det finns inga andra värden."
                    ]
                }
            ],
            "comment": []
        },
        {
            "level": 1,
            "title": [
                "📣 Några kommentar om boolean"
            ],
            "description": [
                "Boolean är en förhandevis snäll typ som inte nställer till problem, men ..."
            ],
            "statments": [
                {
                    "description": [
                        "Du ska undvika att använda aritmetiska operatorer"
                    ]
                },
                {
                    "description": [
                        "Exempel: ",
                        [
                            {
                                "form": "important"
                            },
                            "true +treu //2"
                        ],
                        " - ",
                        [
                            {
                                "form": "important"
                            },
                            "true/false //infinity"
                        ]
                    ]
                },
                {
                    "description": [
                        "Boolean har nästan inga egna metoder."
                    ]
                },
                {
                    "description": [
                        "Men ",
                        [
                            {
                                "form": "important"
                            },
                            "toStrng()"
                        ]
                    ]
                }
            ],
            "comment": []
        },
        {
            "level": 1,
            "type": "application",
            "title": [
                "Vad använder vi då Boolean till?"
            ],
            "description": [
                "Så fort du vill vet om något är sant eller falskt."
            ],
            "statments": [
                {
                    "description": [
                        "Du behöver används vilkor i någon sats."
                    ]
                },
                {
                    "description": [
                        "Det kan också vara bra om du ska använda en fflaga\" i koden."
                    ]
                },
                {
                    "description": [
                        "Du vill till exempel veta om koen har kort en gång förut."
                    ]
                },
                {
                    "description": [
                        "Om denna kod ska köras eller funktionaliteten är bortvald."
                    ]
                }
            ],
            "comment": []
        },
        {
            "level": 1,
            "title": [
                "🀄️ Boolean i andra språk?"
            ],
            "description": [
                "Det finns i andra språk."
            ],
            "statments": [
                {
                    "description": [
                        "Boolean använda i alla nyare programmeringsspråk"
                    ]
                },
                {
                    "description": [
                        "I äldre varinater så som C så använder du:"
                    ]
                },
                {
                    "description": [
                        "0 för falskt"
                    ]
                },
                {
                    "description": [
                        "1 för sant"
                    ]
                },
                {
                    "description": [
                        "resten är också sant."
                    ]
                }
            ],
            "comment": []
        },
        {
            "level": 1,
            "title": [
                "🔄 Att konvertera till och från Boolean."
            ],
            "description": [
                "För att konvertera till ett Number använder vi funktionen Boolean()."
            ],
            "statments": [
                {
                    "description": [
                        "Boolean(\"true\") //true för att omvandla text till Boolean."
                    ]
                },
                {
                    "description": [
                        "Number(true) //1"
                    ]
                },
                {
                    "description": [
                        "Number(false) //0"
                    ]
                }
            ],
            "comment": [
                "Ofta användeer du en jämförese för att \"kovertera\" ett värde till Boolean."
            ]
        },
        {
            "level": 1,
            "title": [
                "🔬 Är det en Boolean?"
            ],
            "description": [
                "Det går bra med en vanlig \"typeof\"."
            ],
            "statments": [
                {
                    "description": [
                        "typeof true //boolean"
                    ]
                },
                {
                    "description": [
                        "typeof false //boolean"
                    ]
                }
            ],
            "comment": []
        },
        {
            "level": 1,
            "title": [
                "Logik"
            ],
            "description": [
                "Ofta använder vi logiska operatorer tillsammans med Boolean."
            ],
            "statments": [
                {
                    "description": [
                        "Och: \"&&\""
                    ]
                },
                {
                    "description": [
                        "Exempel: ",
                        [
                            {
                                "form": "important"
                            },
                            "true && true //true"
                        ],
                        " - ",
                        [
                            {
                                "form": "important"
                            },
                            "true && false //false"
                        ]
                    ]
                },
                {
                    "description": [
                        "Eller: \"||\""
                    ]
                },
                {
                    "description": [
                        "Exempel: ",
                        [
                            {
                                "form": "important"
                            },
                            "true || false //true"
                        ],
                        " - ",
                        [
                            {
                                "form": "important"
                            },
                            "false || false //false"
                        ]
                    ]
                },
                {
                    "description": [
                        "Inte: \"!\""
                    ]
                },
                {
                    "description": [
                        "Exempel: ",
                        [
                            {
                                "form": "important"
                            },
                            "!true //false"
                        ],
                        " - ",
                        [
                            {
                                "form": "important"
                            },
                            "!false //true"
                        ]
                    ]
                }
            ],
            "comment": [
                "Observer de dubla teckena för \"&&\" och \"||\", att bara använda ett tecknena kommer ge oss en helt annan operator."
            ]
        }
    ],
    "kind": "sections"
}