Get started with sugar CDN

MIT licensed

Sugar: library, simplifies tasks, adds functional programming to language.

Tags:
  • functional
  • utility
  • ender

Stable version

Copied!

How to start using sugar CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with sugar CDN - cdnhub.io</title>
  <script src="https://cdn.cdnhub.io/sugar/2.0.6/sugar.min.js"></script>
</head>
<body>
  <button id="add">Add numbers</button>
  <script>
    const add = document.getElementById('add');
    add.addEventListener('click', () => {
      const num1 = Sugar.Int.fromValue(5);
      const num2 = Sugar.Int.fromValue(3);
      const sum = Sugar.Int.plus(num1, num2);
      console.log('Sum:', sum.value());
    });
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions