Javascript


JavaScript® (ECMAScript) - In this section you will find my codes and codes that are related to SoloLearn.



Captcha - I'm Not A Robot
Avoid spam like behavior to implement a captcha to your forms.

Created by Vincent Berger on Jan 26, 2019

Webpage Preloader
Play a nice animation while the webpage preloads.

Created by Vincent Berger on Jan 22, 2019

Spiral Context (Animated)
Spiral Context drawed with Canvas, this is an animation.

Created by Vincent Berger on Jan 21, 2019

Translation System
This code was made for my brothers website, not in use because we had found a plugin that does the job for him which requires no knowledge of scripting.

Created by Vincent Berger on Jan 21, 2019

DOM vs Canvas
In general I will cover the rendering, API's, preformance and memory compared to each other.

Created by Vincent Berger on Jan 21, 2019

Canvas Drawing [DOM vs Canvas]
This code is in context of DOM vs Canvas article.

Created by Vincent Berger on Jan 21, 2019

DOM Drawing [DOM vs Canvas]
This code is in context of DOM vs Canvas article.

Created by Vincent Berger on Jan 21, 2019

Single Quotes vs Double Quotes
Simple basic and logics on single and double qoutes used in a string.

Created by Vincent Berger on Jan 14, 2019

Check If an Array Holds Any Elements
Check if an array holds any elements with 5 different methods.

Created by Vincent Berger on Jan 10, 2019

Simple Bitcoin Invoice
Let your clients receive a simple bitcoin invoice when needed to pay(Real-time).

Created by Vincent Berger on Jan 2, 2019

setInterval() Free Fall
continuation of the nested setInterval().

Created by Vincent Berger on Dec 13, 2018

Nested setInterval()
Working with nested setIntervals() for an attempt to determinate gravity.

Created by Vincent Berger on Nov 8, 2018

Modal Box
Modal box created with JQuery, simple but effective.

Created by Vincent Berger on Nov 6, 2018

Find the Highest Number in an Array
Find the highest number in an array.

Created by Vincent Berger on Nov 3, 2018

Diagonal Loop Rhythm
Loop throught a string to output a diagonal looped rhythm which will be in a vertical order.

Created by Vincent Berger on Nov 3, 2018

1001 Div Tags - Pattern 2
Follow up to education myself on the Javascript library Anime.js

Created by Vincent Berger on Nov 1, 2018

1001 Div Tags - Pattern 1
Follow up to education myself on the Javascript library Anime.js

Created by Vincent Berger on Nov 1, 2018

Proof of Author
This is an attempt to give authority of the author who created the script to avoid plagiarism.

Created by Vincent Berger on Nov 1, 2018

Toggle Between 2 Functions
Toggle between 2 functions with 1 button click.
This will be done to assign a value of true(1) and false(0) within an if .. else statement that toggle's between each execution.

Created by Vincent Berger on Nov 1, 2018

Explicted toUpperCase()
Explicted version of the toUpperCase() method. ☻
There are more ways that leads to a string uppercasing even with everlasting fun.

Created by Vincent Berger on Oct 18, 2018

ToDo List (Simple)
ToDo List.
Handy to crick up your skills in Javascript.

Created by Vincent Berger on Oct 16, 2018

Xmas Tree (For Fun)
This code snippet is pure for fun. ☻

Created by Vincent Berger on Oct 13, 2018

This Keyword (Nested Functions & Owners)
The this keyword in Javascript will refer to it's parent object(object it belongs to) which will most of the time a global object.

Created by Vincent Berger on Oct 12, 2018

Pyrimidal Sequence (Reversed)
Pyrimidal sequence in order and in reversed order.

Created by Vincent Berger on Oct 12, 2018

Anonymous Functions (fat arrow)
In Javascript there a anonymous function AKA fat arrow functions.
This kind of function expression delcares a function that has no keyword.

Created by Vincent Berger on Oct 11, 2018

JQuery Tabs 2
With JQuery, it is very nice to implement certain animations to your script so I created a few tabs that holds different content in each tab.

Created by Vincent Berger on Oct 9, 2018

Circle Animation
This circle animation is created with Anime.js and is one of my favorite animations.

Created by Vincent Berger on Oct 6, 2018

Wave Animation
Creating a wave animation with Anime.js.

Created by Vincent Berger on Oct 6, 2018

Move Div Random
Derived from a question asked in SoloLearn. Move a div element and animate it randomly accros the clients screen.

Created by Vincent Berger on Oct 6, 2018

Prime Numbers
Calculating prime numbers with Javascript

Created by Vincent Berger on Oct 5, 2018

2D Act's 3D Animation
When looking into animation that can be done in Javascript, I stumbled accros the Javascripot library: Anime.js
With this library you can make geneuis animations with almost no restrictions.

Created by Vincent Berger on Oct 4, 2018

Random Color via Hex Values
Generate random color codes and colours with the hexadecimal table values.

Created by Vincent Berger on Oct 4, 2018

JQuery Tabs 1
With JQuery, it is very nice to implement certain animations to your script so I created a few tabs that holds different content in each tab.

Created by Vincent Berger on Sep 26, 2018

Progress Bar
When implementing the progress in the Hacker Terminal, I needed to make a simple progress bar to learn more about additions in real-time.

Created by Vincent Berger on Sep 20, 2018

Random Colors
Generate random color with a onclick event. Colors are generated via words(not hex or rgba values).

Created by Vincent Berger on Sep 15, 2018

Remove Duplicates in an Array
Remove duplicates in an array. Check with indexOf() method if there are duplicates in an array with an loop and if statement.

Created by Vincent Berger on Sep 14, 2018

Nested Functions
A nested function is a function within a function, this can be named and anonymous functions.

Created by Vincent Berger on Sep 14, 2018

Load external content (AJAX)
Javascript AJAX allows you to preform GET and POST requests with additonal TCP headers. In this case I will load external JSON objects into the DOM.

Created by Vincent Berger on Sep 13, 2018

Text input with eval
The Javascript eval() function preforms evaluations if the eval() holds any parameter. I will also show how to prevent XSS with an input that evaluates the inputs values.

Created by Vincent Berger on Sep 13, 2018

Refresh div tag in a certain time span
Refresh an HTML element in a certain time span, This will come in handy when you do not want to refresh the whole page but only a certain section.

Created by Vincent Berger on Sep 12, 2018

Hello World with CharCode's
In Javascript the fromCharCode() method selecteds the values from charcode table and converts those values into human readable characters.

Created by Vincent Berger on Sep 11, 2018

Array Map
In Javascript the array map() method maps the every element in an array for a calling function in order.

Created by Vincent Berger on Sep 10, 2018

For loop with setTimeout (String)
Using setTimeout() within a for loop to to iterations in a time span. Used to do iterations output with strings.

Created by Vincent Berger on Sep 8, 2018

For loop with setTimeout (Numbers)
Using setTimeout() within a for loop to to iterations in a time span.

Created by Vincent Berger on Sep 8, 2018

String inside Variable (Template Literals)
Use the backquot ` to use variables insidie the string without cutting the string with + signs. In Javascript this is called a template literal.

Created by Vincent Berger on Sep 1, 2018

Date Object
The date object is used to work with dates and times, it created a new date when declare a 'new Date()' object.

Created by Vincent Berger on Aug 28, 2018

Sort Array Elements (Ascending)
The sort() method in Javascript sorts elements by default in a alphabetic order.

Created by Vincent Berger on Aug 28, 2018

Sort Array Elements (Descending)
The sort() method in Javascript sorts elements by default in a alphabetic order. By reversing the array, the sorted elements will resverse() the alphabetic order.

Created by Vincent Berger on Aug 28, 2018

Primitive Values
In Javascript primitive values is a data type that is not an object nor has a method, therefore primitive values are immutable.

Created by Vincent Berger on Aug 28, 2018

Push Array Elements
The Javascript push() method pushes a new array elements to the end of an array and returns the pushed element(s).

Created by Vincent Berger on Aug 28, 2018

For loop
The for loop provides a iteration of a block of code, decided on the number or length of iteration the loop iterates.

Created by Vincent Berger on Aug 27, 2018

Chatbot
The manipulation of javascript and how it would interact with the client, I attempted to create a chat bot to explore the functionallity behind the interface.

Created by Vincent Berger on Aug 26, 2018

Roll the Dice
First code that haves the funcionallity provided to interact with the client to manipulate the DOM.

Created by Vincent Berger on Aug 22, 2018

Login via Input
Validate the clients inserted username and password.

Created by Vincent Berger on Aug 18, 2018

Login via Prompt
Login via a if .. else statement validation that should be equal to an string value which contains the password by clients input. If not equal it should be redirected to a wrong password error. If equal, then proceed to login page.

Created by Vincent Berger on Aug 13, 2018

Math Objects
Math is a built-in object to do nummerious calculations such as PI, COS, SIN, to preform tasks on numbers.

Created by Vincent Berger on Aug 13, 2018

setInterval & clearInterval
The setInterval() method is a global worker and executes a block of code repeatedly with a fixed time. When calling setInterval it is clearable it use the clearInterval() method.

Created by Vincent Berger on Aug 12, 2018

Else .. If Statement
The else .. if statement is to specity a new condition for the if statement.

Created by Vincent Berger on Aug 10, 2018

If .. Else Statement
The if .. else statement can preform multiple tasks with different conditions while specifing blocks of code to be execution based on the decision of the if .. else statement.

Created by Vincent Berger on Aug 10, 2018

Return Statement
The return statement returns its value(s) after it stops the code from further execution.
When the return statement does not hold any values will this result in undefined (Not an error, warning of zero values).

Created by Vincent Berger on Aug 10, 2018

Arrays
Arrays contains multiple stored elements in one variable.
To acces elements stored in a array, this will be refered to a number, the first element starts with 0.

Created by Vincent Berger on Aug 10, 2018

Object Properties
Properties are values contained by the object. The object is basicly storing properties that can hold unlimited nested properties.

Created by Vincent Berger on Aug 9, 2018

Functions, Names and Parameters
Functions executes certain blocks of code within the function. A function name contains parameter(s) and is mainly used for returning and passing values.
It is not mandotary to use names and parameter for a function.

Created by Vincent Berger on Aug 9, 2018

Variables
Variables stores data values. Declare a variable outside the function to make it global, inside the function it will refer to local which cannot be deraclared. Variables can contain:
strings   numbers   arrays   Primitive values
objects   booleans   special characters

Created by Vincent Berger on Aug 9, 2018

Add Numbers
Javascript addtition operator.
Sum up 2 numbers that are stored for example in 2 variables and how to do calculations with a string that holds a numeric value which makes Javascript so awsome.

Created by Vincent Berger on Aug 9, 2018

If Statement
The if statement is to specify a block of code to be executed, if the condition is true or false.

Created by Vincent Berger on Aug 9, 2018
Back to Top