I have tried to make it simple and I earned FREE PIZZA!. Check my solution for this.
function rot13(str) { var alphabets =['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'," ", "-", "_", ".", "&","?", "!", "@", "#", "/"]; var alphabets13 = ['N','O','P','Q','R','S','T','U','V','W','X','Y','Z','A','B','C','D','E','F','G','H','I','J','K','L','M', " ", "-", "_", ".", "&","?", "!", "@", "#", "/"]; var resultStr = []; for(let i=0; i<str.length; i++){ for(let j =0; j<alphabets.length; j++){ if(str[i] === alphabets[j]){ resultStr.push(alphabets13[j]); } } } return resultStr.join(""); }; rot13("SERR CVMMN!");
Related Posts:
- How to add a class to a given element?
- How to make a word underline in Markdown
- What is lexical scope?
- Remove element by id
- await is only valid in async function
- Remove duplicate values from JS array [duplicate]
- How to read an external local JSON file in JavaScript?
- SyntaxError: Unexpected token o in JSON at position 1
- Remove duplicate values from JS array
- How can I add a key/value pair to a JavaScript object?
- Adding an onclick event to a div element
- Typescript : Property does not exist on type ‘object’
- How to check if array is empty or does not exist?
- How to Create simple drag and Drop in angularjs
- stop all instances of node.js server
- Working with $scope.$emit and $scope.$on
- Using Node.js require vs. ES6 import/export
- How to print elements from array with javascript
- What is the JavaScript version of sleep()?
- How do I scroll to an element using JavaScript?
- Finding largest integer in an array in JavaScript
- javascript set cookie with expire time
- Angular: conditional class with *ngClass
- How can I add a key/value pair to a JavaScript object?
- How do I change an HTML selected option using JavaScript?
- Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
- TypeError: Invalid attempt to spread non-iterable instance
- Declaring multiple variables in JavaScript
- How to print a number with commas as thousands separators in JavaScript
- Convert Array to Object
- How to set the id attribute of a HTML element dynamically with angularjs (1.x)?
- Partial render in HTML/JavaScript
- How can I check if a string is a valid number?
- Javascript setInterval not working
- Javascript Regular Expression Remove Spaces
- image.onload event and browser cache
- How to add a keyboard listener to my onClick handler?
- GulpUglifyError:Unable to minify JavaScript
- Uncaught TypeError: Cannot read property ‘toUpperCase’ of undefined
- why angularjs ng-repeat not working
- jQuery remove options from select
- Convert UTC Epoch to local date
- How to execute a JavaScript function when I have its name as a string
- How to get the ASCII value in JavaScript for the characters [duplicate]
- HTML img onclick Javascript
- Clear the cache in JavaScript
- error Unable to get property ‘display’ of undefined or null reference
- Is there a php echo/print equivalent in javascript
- Javascript: difference between a statement and an expression?
- Keep getting a “Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup” when attempting to google plus login on my web app
- The entity name must immediately follow the ‘&’ in the entity reference
- How can I use goto in Javascript?
- Javascript Function that returns true if a letter?
- How do I know which version of Javascript I’m using?
- getContext is not a function
- lodash multi-column sortBy
- navigator.geolocation.getCurrentPosition sometimes works sometimes doesn’t
- Expected ‘this’ to be used by class method
- Strip HTML from Text JavaScript
- Calling a JavaScript function in another js file
- JavaScript code not running in HTML5 document
- What is the cause for “angular is not defined”
- Unexpected token < in first line of HTML
- ngular is automatically adding ‘ng-invalid’ class on ‘required’ fields
- How to set “style=display:none;” using jQuery’s attr method?
- Await is a reserved word error inside async function
- Javascript WP Object Documentation?
- Show only images and videos in a wp.media window
- WordPress Rest API
- Instantiate TinyMCE via JS ( rather than PHP/wp_editor )
- Force core to use .dev JavaScript files
- TinyMCE Button to Insert Multiple Lines of Text?
- How to add extra attributes to the script tag added via wp_localize_script()
- Prevent escaping javascript in visual editor
- How to place script in footer?
- Only displaying zip files with wp media
- Adding a Javascript slideshow to the home page
- List of JS Events for Widgets?
- Authentication with the Rest API when using an External Application
- Open Featured Image Modal in WordPress Gutenberg onClick of a button
- Screen Resolution Detect
- Override do_item() Function to Add Extra Attribute to Scripts
- Is it possible to pass js variable to template file
- Automatically Add Defer or ASYNC to all JS files (no matter where they are located)
- Uncaught ReferenceError: jQuery is not defined – although jQuery is loaded [closed]
- How can I import one custom block into another?
- Gutenberg Blocks: how to determine an index of the current inner block?
- find out reason of “Updating failed” in Post-editor
- Getting a variable inside foreach from PHP to JS after localization
- Custom JS on a specific page
- How to import a JavaScript Library into WordPress
- How to change the link address from internal to external
- Uncaught TypeError: Cannot read property ‘add’ of undefined bp-plupload.min.js
- Where is the Javascript attribute window._wpCustomHeaderSettings defined?
- How to verify that a field has a value before adding a term to a taxonomy
- how to include js in widget?
- List unused javascript for easy removal
- Include Facebook Javascript SDK In WordPress
- Why is this script not working?
- Astra Mobile Cart Drawer is blank on home page