Use async/await keywords together with Promise.all() to load multiple images together. This can speed up sketch loading, because the images will be loaded at the same time, instead of one after the other. The images are drawn together on the canvas only after they all finish loading.
Using multiple calls to loadImage() inside a Promise.all() works with other functions that load resources. For example, loadFont() in this video tutorial on Typography and Asset Loading by Qianqian Ye.
Load Multiple Images with Promise.all: Edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.
관련 예제

대체 텍스트 없음
로컬 스토리지(Local Storage)
브라우저에서 기기에 데이터를 저장합니다.

대체 텍스트 없음
JSON
JSON(JavaScript Object Notation)으로 데이터를 저장합니다.

대체 텍스트 없음
테이블
데이터를 쉼표로 구분된 값(CSV)으로 저장합니다.

Three random images loaded and displayed on a canvas after using async/await and Promise.all.
Load Multiple Images with Promise.all
Load multiple files at the same time before drawing on canvas.