[Solved] refactoring/making the code better in javascript [closed]

Yes, you should use switch statement here. Chaining so many else if’s is considered bad practice. You can read about switch statement here. https://www.w3schools.com/js/js_switch.asp Code would look something like: function likes(names) { if(names.length<0) { return `${names} likes this`; //return early if possible } let answer=””; switch (names.length) { case 0: answer = `no one likes … Read more

[Solved] adding a facebook Like IMAGE to site (but keeping with FB TOS/Platform Policy) [closed]

So you want a Share button rather than a like button? Keeping in mind that this has been deprecated in favor of the like button, just create your share URL and link to it http://www.facebook.com/sharer.php?u=<url to share>&t=<title of content> 5 solved adding a facebook Like IMAGE to site (but keeping with FB TOS/Platform Policy) [closed]