ShahbazKhan45 / -Contour-Bootcamp-Classes-Materials

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

-Contour-Bootcamp-Classes-Materials

Second Class

Bootstrap

Bootstrap is a free and open-source CSS framework directed at responsive, mobile-first front-end web development.
It contains HTML, CSS and JavaScript-based design templates for typography, forms, buttons, navigation,
and other interface components.

How to Link Bootstrap

Method 1: Using the Bootstrap Content Delivery Network (CDN)
For CSS

Copy this stylesheet link to the tag of your desired HTML file.

    #For CSS
    "<link rel=stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css”rel=”nofollow”
        integrity=”sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm” crossorigin=”anonymous”>"

    #For JS
    <p>Copy this stylesheet before the end of the <body> tag of your desired HTML file. <br>
            <script src=”https://code.jquery.com/jquery-3.2.1.slim.min.js”
                integrity=”sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN”
                crossorigin=”anonymous”></script>

            <script src=https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js
                integrity=”sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q”
                crossorigin=”anonymous”></script>

            <script src=”https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js”
                integrity=”sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl”
                crossorigin=”anonymous”></script>
    </p>

    You can easily use the bootstrap through its class example is mentioned below:
    <div class="container">
        <div class="row">
            <div class="col-md-12">Good Luck :)</div>
        </div>
    </div>

Containers

Containers are the most basic layout element in Bootstrap and are required when using our default grid system.
Containers are used to contain, pad, and (sometimes) center the content within them.
The w3-container class is the perfect class to use for all HTML container elements like:

Break Points

CSS breakpoints are points where the website content responds according to the device width,
allowing you to show the best possible layout to the user. CSS breakpoints are also called
media query breakpoints, as they are used with media query

Components

Over a dozen reusable components built to provide iconography, dropdowns, input groups, navigation, alerts, and much more.

Buttons

Use Bootstrap's custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.


Programming Fundamentals

Programming involves activities such as analysis, developing understanding, generating algorithms, verification of requirements of algorithms

Datatypes

In Javascript, there are five basic, or primitive, types of data.
The five most basic types of data are:

  • Strings ==> var a="Shahbaz Khan";
  • Numbers ==> let b = 7;
  • Booleans ==> let c = true;
  • Undefined ==> var d;
  • Null In JavaScript null is "nothing". It is supposed to be something that doesn't exist.
    Unfortunately, in JavaScript, the data type of null is an object.

    ==> let person = {firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"}; person = null;
  • Object ==> let person = {firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"};

Arrays

In JavaScript, the array is a single variable that is used to store different elements.
It is often used when we want to store a list of elements and access them by a single variable.
// Initializing while declaring var house = ["1BHK", "2BHK", "3BHK", "4BHK"];

Loop

Loops are used in JavaScript to perform repeated tasks based on a condition.
Conditions typically return true or false . A loop will continue running until
the defined condition returns false

for (initialization; condition; finalExpression) {
    // code
  }

//example for (let i = 0; i < 9; i++) { console.log(i); }

  // Output:
  // 0
  // 1
  // 2
  // 3
  // 4
  // 5
  // 6
  // 7
  // 8

Function

A function is a block of code that performs a specific task

function hello(){
    console.log("Hello!");
}

hello()

Conditions

Conditions are statements that are created by the programmer
which evaluates actions in the program and evaluates if it's true or false.

If-then-else statement allows conditional execution based on the evaluation of an expression


JavaScript

Arrow

Arrow function is one of the features introduced in the ES6 version of JavaScript.
It allows you to create functions in a cleaner way compared to regular functions.
For example, This function

/* function expression*/
let x = function(x, y) { return x * y; }

Clousure

A clousure function is an inner function that has access to the outer (enclosing) function's variable.
function outerFun(){ var text1 = "This is outer text of variable"; function innerFun(){ var text2 = `This is inner Text of the variable and ${text1}`; console.log(text2) } innerFun() } outerFun();

Recursion

Recursion is a process of calling itself. A function that calls itself is called a recursive function.
The syntax for recursive function is:
// program to find the factorial of a number function factorial(x) {

// if number is 0
if (x === 0) {
    return 1;
}

// if number is positive
else {
    return x * factorial(x - 1);
}

}

const num = 3;

// calling factorial() if num is non-negative if (num > 0) { let result = factorial(num); console.log(The factorial of ${num} is ${result}); }


Normal Function

<script> k = 1; function A() { this.k = 2; return function B() { console.log(this.k); } } A(); //
  var person = {
      age: 28,
      greet1: function () {
          console.log("Greet 1", this.age);
          console.log("Greet 1", this);
          function greet2() {
              console.log("Greet 2", this.age);
              console.log("Greet 2", this);
          }
          greet2();
      }
  }
  person.greet1();
  // 
  var person = {
      age: 28,
      greet1: function () {
          console.log("Greet 1", this.age);
          console.log("Greet 1", this);
          greet2 = () => {
              console.log("Greet 2", this.age);
              console.log("Greet 2", this);
          }
          greet2();
      }
  }
  var abc = () => {
      return person.greet1()
  }
  abc();
</script>

About