JavaScript programs

JavaScript programs

Share

This page will help people without the knowledge of programming to start from scratch up the level o

08/09/2022

Lucky dude...

U.S govt. agrees to reduce Hushpuppi’s sentence to 11yrs for helping detectives solve other criminal cases

Prosecutors in the United States have asked a federal judge to sentence Ramon ‘Hushpuppi’ Abbas to 11 years in prison and three years of supervised release for his role in a multinational conspiracy that earned him millions of dollars between 2019 and 2020.

According to Peoples Gazette, American attorneys led by Khaldoun Shobaki in the U.S. Central District of California (Los Angeles) argued that Hushpuppi should also be asked to pay $1.7 million in restitution; $500K in fines and $100 in administrative fees, per recommendations submitted ahead of his sentencing on September 21.

The development came more than two years after the infamous Internet fr@ud ringleader was arrested in Dubai in June 2020 for driving multiple schemes that targeted victims in Europe and the United States. He pleaded guilty in April 2021 after prosecutors discovered his involvement in a separate conspiracy to defraud a Qatari businessperson, who lost $810K in the process of trying to obtain an elusive loan to set up an international school.

The prosecutors argued that their sentencing recommendations were appropriate considering the gravity of Hushpuppi’s crimes. The government said one of his co-conspirators Ghaleb Alaumary was sentenced to 140 years in jail for violating the same set of criminal codes.

“By his own admission, during just an 18-month period defendant conspired to launder over $300 million,” the prosecutors said. The government said Mr Abbas’ criminal path was premeditated, even though he had a clear chance to choose a rewarding career as a law-abiding citizen.

Mr Abbas’ sentencing, the government argued, was reduced because he cooperated with detectives on our criminal cases under investigation and prosecution in American courts.

19/08/2021

As JavaScript is executed on client side and is generally a bad idea to expose the database directly to the user (even if it is read-only), you should create a server side service (use any script or programming language you prefer or know) which will provide a necessary interface between the client (running your JavaScript code) and the database.
A good example is to create an API and communicate with it via AJAX calls. You can send requests with additional information needed for data selection, filtering and sorting. This information can be included in the request's GET or POST (or any other) method (verb) as defined by the HTTP protocol.
Example:
JavaScript binds to a click event on a DOM element (button to load some info).
User clicks and an event is triggered. JavaScript function handles this event.
This JavaScript function creates a request to be sent to the server. Say that it is a JSON string object: { "controller" : "Users", "method" : "getActiveUserCount" }.
This JSON string is sent to the service on the server via a HTTP POST request.
An animation is started to give the user some idea that a process is being executed in the background (optional).
The service picks it up and handles it = executes the getActiveUserCount method of the Users class (controller). The result is also a JSON string (an object), for example: { "status" : "ok", "numberOfActiveUsers" : 351 }
The client picks up this response and checks the JSON object's status value (if "ok", which it is in this example, continues) and then displays the numberOfActiveUsers value from the same returned object.
The animation is stopped. (optional).
The click event has been fully handled.

18/08/2021

//Playing with arrays is fun!!
var val=[9,4,6,2,8,10,15];
//square all values in array
const valSquare= val.map(val=>Math.sqrt(val));
console.log(valSquare);
Output1: ********
//multiply all values by two
const valTimesTwo= val.map(val=>val*2);
console.log(valTimesTwo);
Output2:**********
//multiply all values by power 2
const valPowerTwo= val.map(val=>val**2);
console.log(valPowerTwo);
Output3:********
// sort values from the lowest to the highest
const valSort= val.sort()
console.log(valSort);
// result is weird
Output4:*********
const
mySortVal=val.sort((a,b)=>a-b);
console.log(mySortVal);
// better result in ascending order
Output5:********
const myValSort= val.sort((a,b)=>b-a);
console.log(myValSort);
// better result in descending order
Output6: *******
//Add all values together using loop and reduce
let valSum=0;
for(let i=0; i=5){
valVal.push(val[i]);
}
}
console.log(valVal);
Output14:******
NB: Let see ur output(s)

Want your school to be the top-listed School/college in Abuja?
Click here to claim your Sponsored Listing.

Category

Telephone

Address


Abuja