kafiya.hashnode.devCoding physics with p5.js - Part II: Euler integration“An object at rest will stay at rest and an object in motion will stay in motion” -Newton’s first law. I personally interpret this law as follows: unless an object experiences a force, its speed and direction remain unchanged. Nothing will speed it u...Dec 2, 2025·2 min read
kafiya.hashnode.devCoding physics with p5.js vectors - Part IPhysics is a really important subject when it comes to coding, especially when you’re trying to recreate real life. One of the most common uses is in games, for example, when we need to code a car crashing in a racing game or a ball falling in a foot...Dec 1, 2025·4 min read
kafiya.hashnode.devSpread and Rest OperatorsBased on usage … operator is called spread or rest operator.Spread works on arrays/iterables and objects, while rest is only for function parameters (and destructuring). “Spread” - when it expands an iterable (arrays, strings, sets, maps) into indivi...Nov 13, 2025·1 min read
kafiya.hashnode.devMap( ) array helperThe map() helper is an array method that creates a new array by applying a callback function to transform each element of the original array. The callback receives three parameters: (element, index, array). const array = [2,4,3]; let newArray = ar...Nov 11, 2025·1 min read
kafiya.hashnode.devforEach() array helper methodThe forEach() method is an iterative array helper that abstracts away the traditional for loop.In other words, ES6 introduced forEach to simplify array iteration and make code more readable. The forEach() method calls the provided callback function o...Nov 10, 2025·2 min read