3 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

Heyo!

Check out this sneak peek for the Briar Original Game Soundtrack I've worked on! I'm planning a proper video when the game releases, but it looks like Streaming Services got ahead of us...

youtube.com/watch?v=yrOTiqwqzzc&list=OLAK5uy_nLayYYMpXpBZqMWE9Gd…

Me: "Hey! Can you sing this?"

Singer:

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

Anime gore ahead watch out! (And spoilers too)

This took me a whole day but I'm super darn happy with the dynamic outcome given my limited skill-set! I'll be continuing with the shading and animation tomorrow

#beastars

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

Man they did this character so dirty....

It could have been based on a misunderstanding from young Melon's perspective, but then they drop the other scene out of nowhere rip

#beastars

The entire OST for @Raccoonicorn 's Briar is officially ready! It's been a long and fun ride for sure :D

I'm super happy I could have been a part in it, the amount of time and effort put into this game never fails to amaze me