Coder Social home page Coder Social logo

html-intro-and-javascript-basics's Introduction

HTML-Intro-and-JavaScript-Basics

  1. Assignment Operator (=):

    • var1 = 3; assigns the value 3 to the variable var1.
    • var2 = 4; assigns the value 4 to the variable var2.
    • var1 = var1 + 7; adds 7 to the current value of var1 and updates the value of var1 to the result, which is 10.
  2. Inequality Operator (!=):

    • var1 != 10 checks if the value of var1 is not equal to 10. In this case, it evaluates to true because var1 is indeed not equal to 10.
  3. Mathematical Operators (+, -, sqrt, ceil):

    • var1 + 7 adds 7 to the value of var1, resulting in 10.
    • Math.sqrt(var1) calculates the square root of var1, which is approximately 3.162.
    • Math.ceil(Math.sqrt(var1)) calculates the ceiling value of the square root of var1. In this case, it rounds up 3.162 to 4.
  4. Logical Operator (&&):

    • Although the code provided does not include the logical AND operator (&&), it's a fundamental operator in JavaScript used for combining conditions in logical expressions.

The code also includes HTML and JavaScript to display the value of the first paragraph on the web page in the console. It demonstrates the use of the getElementsByTagName method to access HTML elements and log their content to the console when the page loads.

This code is a simple introduction to some of the core JavaScript operators and their application within a basic web page. It's a starting point for those learning JavaScript and web development.

html-intro-and-javascript-basics's People

Contributors

tina-muriu avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.