Created
March 15, 2023 13:01
-
-
Save alekpopovic/16e7b565e32a0fa6778aeed3f4064039 to your computer and use it in GitHub Desktop.
ruby varst to js object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= | |
name = "Aleksandar" | |
age = 41 | |
city = "Mozgovo" | |
%> | |
<script> | |
var object = JSON.parse('{"name":"<%= name %>", "age":"<%= age %>", "city":"<%= city %>"}') | |
console.log(object) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment