Javascript and webdev (21)

6 Name: Anonymous Techie : 2022-03-07 10:13 ID:Heaven

Searched for "javascript performance tips"

Interesting points are

HTTP/2 uses multiplexing, therefore allowing multiple requests and responses to be sent at the same time.

Use a compression method such as Gzip or Brotli to reduce the size of your JavaScript files.

This thing:

var Person = Object.create({
init: function(name) { = name;
do: function(callback) {
var bob = new Person('bob'); {
alert(; // 'bob' is alerted because 'this' was rewired

This thing, though I prefer to keep the necessary javascript right in the html:

// load example.js without interrupting your webpage's rendering
<script src="example.js" async></script>
// load example.js after the page has finished loading
<script src="example.js" defer></script>

Animate with requestAnimationFrame

Name: Link:
Leave these fields empty (spam trap):
More options...