2 years ago

Question regarding Javascript


I have an object render.singleBuild containing several functions.

I would like to be able to do a forEach loop on this object and execute all its functions, instead of calling them one by one like:

		
			render.singleBuild.header;
render.singleBuild.downloadArea;
		
	

I currently have, but after some extensive search I still couldn't find how to call them

		
			Object.keys(render.singleBuild).forEach(f => ???);
		
	

A simple (f => f()) doesn't work, nor (f => (f)()) nor (f => eval(f))

Any suggestions? Maybe the function definition should be different in the singleBuild object?

@CROS @YLivay because you're cool and sometimes help me out plz



5 comments

Loading...

Next up

It's Game Maker time, first time try

Maybe I'll share a functioning game after all these years? This one will be called Pizzalivery, I'll let you guess the silly game mechanics. I've created some cars in Asperite

Stole it from someone who stole it from someone

You may choose a letter, and I shall answer

(No you may not create 26 alt accounts to cover all letters of the alphabet lol)

Welcome to 'Mytherland' - a brand new interactive community website which will open very soon: https://myther.land

They removed my verified badge

Also here's something silly, work-in-progress silly

Lore: Truddy put her glasses on the Crocodile's dog, they be silly

Flappy pizza delivery

Stickit' Truddy, web-project introduction

A website where you can Collect and Swap stickers with friends and fill up your collector's albums!

Join dev journey at gamejolt.com/c/stickit-kt5adm

#webdev #art

I hate captchas. The quicker you try to solve them to more likely you're flagged as a robot.

Also look, I am going to work on a portfolio with all my projects, their makings documented all in great details :)