Generation

generate functionMon, 24 Apr 2023

Write a function in javascript that takes a text as input and converts the text into a "Hacker" writing style. It converts the following letters to numbers l > 1; o > 0; e > 3; s > 5; o > 6; z > 7; g > 9; The function returns with the transformed textd.

function hackerText(text) { var newText = text.replace(/l/g,'1').replace(/o/g,'0').replace(/e/g,'3').replace(/s/g,'5').replace(/o/g,'0').replace(/z/g,'7').replace(/g/g,'9'); return newText; } hackerText("LOVE you"); // "L0V3y0u" hackerText("Hearts"); // "H34rt5"

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant