JavaScript Everywhere!

Introduction

Frontend

Vanilla JS

<script type="text/javascript">  
function getcube(){  
 var number = 
 	document.getElementById("number").value;  
 alert(number*number*number);  
}  
</script> 

<form>  
Enter No:
<input type="text" id="number" name="number"/>
<br/>  
<input type="button" value="cube" onclick="getcube()"/>  
</form>  

Backend

serverless

CloudFront Functions

Lambda@EDGE

Mobile

Hybrid Apps

Native

Desktop

Graphics

database

NoSQL

db.inventory.insertMany([
   { item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" },
   { item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "A" },
   { item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" },
   { item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" },
   { item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" }
]);

db.inventory.find( {} )


db.inventory.find( { status: { $in: [ "A", "D" ] } } )
CREATE OR REPLACE FUNCTION crq() RETURNS int
LANGUAGE plv8 AS
$$
     var h = plv8.prepare(
          'select count(*) from pg_class'
     );
     var r = h.execute()[0].count;
     h.free();
     return r;
$$;

ORM/ODM

IoT

Infrastructure as a Code
(IaaC)

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;

contract Coin {

    event Sent(address from, address to, uint amount);

    constructor() {
        minter = msg.sender;
    }

  
    function mint(address receiver, uint amount) public {
        require(msg.sender == minter);
        balances[receiver] += amount;
    }

    error InsufficientBalance(uint requested, uint available);

    function send(address receiver, uint amount) public {
        if (amount > balances[msg.sender])
            revert InsufficientBalance({
                requested: amount,
                available: balances[msg.sender]
            });

        balances[msg.sender] -= amount;
        balances[receiver] += amount;
        emit Sent(msg.sender, receiver, amount);
    }
}

JavaScript Everywhere!

By Andrey Kucherenko

JavaScript Everywhere!

  • 859