What Symbols are used in coding?   Part 1

What Symbols are used in coding? Part 1

1.Semicolon ;

The semicolon tells the compiler you have reached the end of a command or statement. It ends the line of code similar to what a period does for a sentence.

Examples:

var i = 10

 

if (i > 15) document.write("10 is less than 15");;        

2.Curly Braces { }

Curly Braces are used to group statements and declarations. Opening brace needs to be followed by a closing brace or the code will not run. Missing or unbalanced braces are often causes of errors in code.

Examples:

if (boolean expression) {

  // any statement(s)

}


else if (boolean expression) {

  // any statement(s)

}

else {

  // any statement(s)

}        

3.Bracket of Parentheses ()

Brackets of Parentheses control the order of operations of an expression and provide parameters or arguments to a function or method and can be used for comparison.

Examples:

print("Hello World!


||


while (condition)


)        

4.Equals (assigning value) = and is different from == or ===.

Used to assign values to variables.

Example:

int x = 10;        

5.Is Equal to == 

Used to compare two operands are equal or not, if yes then it’s true and if not then it’s false. == ignores the datatype. (=== it compares variables and datatypes of the two values to see if they are equal.) 

Example:

"1" ==  1;            // tru

1 == "1";             // true

0 == false;           // true

0 == null;            // false

0 == undefined;       // false

null == undefined;    // true        

To view or add a comment, sign in

More articles by John Flynn

  • Setting Up Your Coding/Development Environment

    This is going to focus on some of the common tools you will need to set up your coding or development environment from…

    1 Comment
  • Github Copilot and Github Labs Extensions

    So what is Github, Git, Copilot, and other things that can help you code with AI, and why so many # symbols? I wrote…

    1 Comment
  • Ten Tips For Panning Your Day

    If you're anything like me, I like a good plan. No better day to start planning than today.

  • Regular Expression C# or Regex

    Regex can feel overwhelming, until you realize you don't need to memorize everything it can do but just know what it…

  • Most Common Laptop to Monitor Connectors

    Most Common Laptop to Monitor Connectors What are the most common computer monitor cable types? HDMI is the digital…

  • What is Good Friday and how do you observe it?

    In my journey of spiritual enlightenment, I'm learning as much as can about different religions, rituals, and…

  • What is Holi?

    In my journey to explore spirituality. I'm doing a series on different religious beliefs, celebrations, and rituals.

  • What is Scratch?

    The Scratch programming language is a visual programming language developed by the Lifelong Kindergarten Group at the…

  • Why commenting your code is so important and how to do it.

    Commenting your code is important for a number of reasons. First, it allows others (and yourself) to understand what…

  • C# Basics

    C# is a language developed by Microsoft. It is a hybrid of C++ and Java, which makes it a powerful tool for programming.

Insights from the community

Others also viewed

Explore topics