JS Code Snippets For Of And For In Loops

Javascript For Of And For In Loop

In this code snippet, we’ll check out the for of loop in Javascript. You probably already know about the for and while loops. But there is another very useful type of loop present in Javascript called the “for of” loop. It can be used to iterate throught iterable object. I would say it’s the quivalent of the foreach loop in C#.

PHP Sending Emails

In this code snippet, we’ll learn how to send emails with PHPMailer in PHP. First, we’ll need to install the PHPMailer package. We’ll do that using a dependency manager for PHP called Composer. (See this tutorial if you want to know how to install Composer in the first place.)

PHP Code Snippets

PHP Code Snippets

This post contains a list PHP code snippets. In the code snippets, you can find PHP related topics with a quick explanation and a code example. I made this collection of code snippets so that if I ever forget something I can just come here to refresh my memory. Hopefully, you’ll find it useful too.

C# Code Snippets String Interpolation

C# String Interpolation

In this tutorial, we will take a look at string interpolation in C#. To enable string interpolation put the $ character before the string. Now variables in brackets can be put straight into a string. This is a bit more convenient compared to splitting up as string, putting the desired variables in between the strings and than concatenating it all together.

C# Code Snippets @ and String Literals

C# @ And String Literals

In this tutorial, we will take a look at string literals and the @ character in C#. In C# the @ character can either be used to make reserved keywords available as variable names or it can be used to make a string literal. A string literal takes everything in the string literally. For example, you do not have to escape a \ with \\ . Your string can now also span multiple rows in the editor. This can be useful when making SQL statements or HTML, XML, …

C# Code Snippets Break and Continue

C# Break and Continue

In this code snippet, we will take a look at break and continue in C#. break is used to break out of a code block. If done in a loop it will essentially stop the loop from executing. continue is used to inside a loop to skip the current iteration.

C# Code Snippets goto Keyword

C# goto Keyword

In this code snippet, we will take a look at the goto keyword in C#. goto is used to move the control of your program to a label you define beforehand. This can be useful to get out of nested loops, if statements or any nested code blocks in general. You can even make a DIY loop or method using the goto keyword 😁(But you should of course use the regular loops and methods).

Advertisment ad adsense adlogger