Skip to content

Instantly share code, notes, and snippets.

@LinZap
Last active June 10, 2019 23:18
Show Gist options
  • Save LinZap/14bac03493239c338b201af684bd4aed to your computer and use it in GitHub Desktop.
Save LinZap/14bac03493239c338b201af684bd4aed to your computer and use it in GitHub Desktop.
Node.js - HK8
const proc_strng = require('./proc-string')
console.log(proc_strng.string_to_array('Hello world'))
console.log(proc_strng.string_to_int('00007777777'))
// put in node-homework/proc-string
function string_to_array(str){
return str.split('')
}
function string_to_int(str){
return parseInt(str)
}
module.exports = {
string_to_array : string_to_array,
string_to_int : string_to_int,
}
['H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']
7777777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment