는 함수의 매개 변수로 데이터 구조를 전달할 수 있습니다 자바 스크립트에서자바 스크립트에서 매개 변수로 전달되는 문장 및 단어의 배열을 얻는 방법은 무엇입니까? 나는 기능이
var init = function(data){
all sentences: " I have to get all the sentences and return an array containing all sentences"
all words : "this method should return an array of words in ‘Data’ when there is no parameter passed in. Optionally, when there is a parameter passed in that is a number, return the words in the sentence indicated by the input parameter"
all reverse sentences: "this method is the same as all Sentences, except it should return the sentences in reverse order"
reverse words :" same as all words but in reverse order"
countWordsBeginningWith:" this method should return the amount of words that begin with an inputted string. The optional second parameter should determine what sentence the words come from when present."
감사
이 숙제입니까? – drudge
여기서 정확히 무엇을하길 원하십니까? –
나는 복잡한 객체를 함수에 전달해야하는 비슷한 종류의 상황이있다. 나는 나와 함께 작동하는 코드를 가지고있다 ... 나는 그것을 최적화 할 수 있는지보고 싶어한다. @ jnpcl this 숙제가 아니다. (아무런 조언이 없다면 말하지 말아라.) ... 내 상황에서 JSON 객체를 서버에서 가져와야하고 특정 키에 접근해야하고 조작해야한다. .. JSON 객체에 대해 걱정하지 않지만 효율적으로 조작하는 것은 문제입니다. – paul