Sugar.js Jump Start PRO

Just as it sounds. Using Sugar.js is kind of adding some sugar to our code. Sugar.js isn’t a framework for creating magnificent user interface, one page web application or manipulating the DOM. Sugar.js is a simple libray that provides us with lots of useful functions we can use in order to write shorter code.

The following code sample shows how simple it is to use Sugar.js. It includes a small demo for calling one of Sugar.js functions that allows us getting a simple new array based on an existing one.

<!DOCTYPE html>
<html>
<head>
    <title>sugar demo</title>
    <script type="text/javascript" src="sugar-full.min.js"></script>
</head>
<body>
<script type="text/javascript">
    var firstVec = [101,200,303,402,505];
    var secondVec = firstVec.last(3);
    for(var i=0; i<secondVec.length; i++)
    {
        document.write("<br>"+secondVec[i]);
    }
</script>
</body>
</html>

The following video clip overviews the above code sample, shows its execution and explains it step by step.

You can find more training material including video clips, code samples and slides for learning this library in my free (for personal and academic usage) online courses at http://abelski.lifemichael.com.

Share:

The Visitor Design Pattern

The Visitor Design Pattern

The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.

What are Anti Patterns?

Anti Patterns

Unlike design patterns, anti patterns just seem to be a solution. However, they are not a solution and they cause additional costs.

Virtual Threads in Java Professional Seminar

Virtual Threads in Java

The use of virtual threads can assist us with improving the performance of our code. Learn how to use virtual threads effectively.

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences